Logs a user in if a session identifier is available under the given token in the token cache.

@param string $token
@return void
189158
public function tokenLoginAction($token)
    {
        $newSessionId = $this->loginTokenCache->get($token);
        $this->loginTokenCache->remove($token);

        if ($newSessionId === false) {
            $this->systemLogger->log(sprintf('Token-based login failed, non-existing or expired token %s', $token), LOG_WARNING);
            $this->redirect('index');
        }

        $this->systemLogger->log(sprintf('Token-based login succeeded, token %s', $token), LOG_DEBUG);

        $newSession = $this->sessionManager->getSession($newSessionId);
        if ($newSession->canBeResumed()) {
            $newSession->resume();
        }
        if ($newSession->isStarted()) {
            $newSession->putData('lastVisitedNode', null);
        } else {
            $this->systemLogger->log(sprintf('Failed resuming or starting session %s which was referred to in the login token %s.', $newSessionId, $token), LOG_ERR);
        }

        $this->replaceSessionCookie($newSessionId);
        $this->redirect('index', 'Backend\Backend');
    }
390569
private function _detectVisibility($token) {
		if ($this->tokenizer->checkToken($token, T_PRIVATE)) {
			$this->_functionVisibility = 'PRIVATE';
		} else if ($this->tokenizer->checkToken($token, T_PROTECTED)) {
			$this->_functionVisibility = 'PROTECTED';
		} else if ($this->tokenizer->checkToken($token, T_STATIC)) {
			$this->_functionStatic = true;
		}
	}
6298
public static function isTokenValid(string $token): bool
    {
        if (!static::hasTokenStored()) {
            return false;
        }

        $storedToken = static::getStoredToken();
        return $storedToken->getToken() === $token;
    }
366143
private function _checkPhpTagsStartLine($token) {
		if ($this->_isActive('phpTagsStartLine')) {
			if (!$this->_isLineStart) {
				$this->_writeError('phpTagsStartLine', $this->_getMessage('PHP_TAGS_START_LINE'));
			}
		}
	}
719861
public function findByActivationToken($token)
    {
        $userMeta = $this->userMeta->where('activation_token', $token)->first();

        if ($userMeta) {
            return $userMeta->user()->first();
        }

        return false;
    }
427358
private function useOAuthTokenFromCache()
    {
        if (!$this->use_cache_token) {
            return;
        }

        $this->oauth_tokens = \Cache::get($this->getOauthTokensCacheKey(), []);
        if (!empty($this->oauth_tokens)) {
            $this->printLine("Using OAuth Tokens from cache:");
            $this->printArray($this->oauth_tokens);
        }
    }
1064350
protected function storeToken(string $token)
    {
        $cookies = $this->getCookies();
        $cookies['token']['domain'] = '.doodle.com';
        $cookies['token']['truefalse'] = 'TRUE';
        $cookies['token']['path'] = '/';
        $cookies['token']['truefalse2'] = 'FALSE';
        $cookies['token']['something'] = '0';
        $cookies['token']['name'] = 'Token';
        $cookies['token']['value'] = $token;
        $cookies['d-betaCode'] = $cookies['DoodleAuthentication'];
        $cookies['d-betaCode']['name'] = 'd-betaCode';
        $cookies['d-betaCode']['value'] = true;
        $cookies['d-forceBeta'] = $cookies['DoodleAuthentication'];
        $cookies['d-forceBeta']['name'] = 'd-forceBeta';
        $cookies['d-forceBeta']['value'] = false;
        $this->persistCookies($cookies);
        $this->token = $token;
    }
1126406
public function set($username, $token)
    {
        $this->memcached->set($this->prefix.$username, $token);
    }
837772
public function check($token)
    {
        $blacklistedToken = $this->model
            ->where('user_id', $this->Token->getSubject($token))
            ->where('expiry', '>', Carbon::now())
            ->whereToken($token)
            ->first();

        if ($blacklistedToken === null) {
            return true;
        }

        throw new BlacklistedTokenException();
    }
1361275
public function expireAuthorizationCode($token)
    {
        $authCodeDataMapper = $this->getTokenDataMapper(Entity\AuthorizationCode::class);

        $authorizationCode = $authCodeDataMapper->findByToken($token);
        $authorizationCode->setExpiryDate(new DateTime());

        $authCodeDataMapper->save($authorizationCode);
    }
183398
public function validateRandomSessionToken(string $token): bool
    {
        if (!isset($this->session[$this->name])) {
            return false;
        }

        return $token == $this->session[$this->name];
    }
1145091
final public function getAuthenticationInfo($token)
    {
        // TODO: Retrieve Authentication Info from Cache
        $authInfo = $this->doGetAuthenticationInfo($token);
        if ($authInfo) {
            $this->_matchCredentials($token, $authInfo);
        }

        return $authInfo;

    }
1192079
protected function saveAccessToken($token) {
		$this->setState('auth_token', $token['access_token']);
		$this->setState('expires', isset($token['expires_in']) ? time() + (int)$token['expires_in'] - 60 : 0);
		$this->access_token = $token['access_token'];
	}
583362
public function activateUser($token)
    {
        $activation = $this->getActivationByToken($token);

        if( $activation === null ) {
            throw new \Exception(trans('HCACL::users.activation.bad_token'));
        }

        $user = $this->getUser($activation);

        if( is_null($user) )
            throw new \Exception(trans('HCACL::users.activation.user_not_found'));

        // activate user
        $user->activate();

        // delete activation code
        $this->deleteActivation($token);

        // login user to the site
        auth()->login($user);
    }
1308114
protected function clearToken($token)
    {
        $token = $this->tokenize($token);
        $this->checkToken($token);
        $this->tokens[$token] = array();
    }
1230536
private function authenticateUser($token)
    {
        $this->imgur->setAccessToken($token);
        // Refresh the token if neccessary
        if($this->imgur->checkAccessTokenExpired())
        {
            $this->imgur->refreshToken();
        }
    }
964063
public function loginViaToken($token)
    {
        $user = $this->userDao->getUserByToken($token);
        if ($user) {
            $this->loginWithoutPassword($user->getLogin());
            return true;
        } else {
            return false;
        }
    }