lib/private/User/Session.php
/**
	 * Log an user in with a given token (id)
	 *
	 * @param string $token
	 * @return boolean
	 * @throws LoginException if an app canceled the login process or the user is not enabled
	 */
Log an user in with a given token (id)
@param string $token
@return boolean
@throws LoginException if an app canceled the login process or the user is not enabled
Log an user in with a given token ( id ) @param string $token @return boolean @throws LoginException if an app canceled the login process or the user is not enabled
private function loginWithToken($token) {
		try {
			$dbToken = $this->tokenProvider->getToken($token);
		} catch (InvalidTokenException $ex) {
			return false;
		}
		$uid = $dbToken->getUID();
		$password = '';
		try {
			$password = $this->tokenProvider->getPassword($dbToken, $token);
		} catch (PasswordlessTokenException $ex) {
		}
		$this->manager->emit('\OC\User', 'preLogin', array($uid, $password));
		$user = $this->manager->get($uid);
		if (is_null($user)) {
			return false;
		}
		return $this->completeLogin(
			$user,
			[
				'loginName' => $dbToken->getLoginName(),
				'password' => $password,
				'token' => $dbToken
			],
			false);
	}
private function loginWithToken ( $ token ) { try { $ dbToken = $ this -> tokenProvider -> getToken ( $ token ) ; } catch ( InvalidTokenException $ ex ) { return false ; } $ uid = $ dbToken -> getUID ( ) ; $ password = '' ; try { $ password = $ this -> tokenProvider -> getPassword ( $ dbToken , $ token ) ; } catch ( PasswordlessTokenException $ ex ) { } $ this -> manager -> emit ( '\OC\User' , 'preLogin' , array ( $ uid , $ password ) ) ; $ user = $ this -> manager -> get ( $ uid ) ; if ( is_null ( $ user ) ) { return false ; } return $ this -> completeLogin ( $ user , [ 'loginName' => $ dbToken -> getLoginName ( ) , 'password' => $ password , 'token' => $ dbToken ] , false ) ; }
Log an user in with a given token (id)
 @param string $token
 @return boolean
 @throws LoginException if an app canceled the login process or the user is not enabled
Log an user in with a given token ( id ) @param string $token @return boolean @throws LoginException if an app canceled the login process or the user is not enabled
// When logging in with token, the password must be decrypted first before passing to login hook // Ignore and use empty string instead // user does not exist