@param SamlSpResponseToken $token

@return null|UserInterface
421773
private function createUser(SamlSpResponseToken $token)
    {
        if (null === $this->userCreator) {
            return null;
        }

        $user = $this->userCreator->createUser($token->getResponse());

        if ($user && false === $user instanceof UserInterface) {
            throw new \LogicException('User creator must return instance of UserInterface or null');
        }

        return $user;
    }
1129054
protected function getUserByToken($token)
    {
        $userUrl = 'https://' . $this->shopURL . $this->adminPath . "shop.json";


        $response = $this->getHttpClient()->get( $userUrl,
                [
                    'headers' => $this->getResponseHeaders($token)
                ]);

        $user = json_decode($response->getBody(), true);

        $this->responseHeaders = $response->getHeaders();

        return $user['shop'];
    }
245309
public function renewToken(?Token $token) : Token
    {
        if ($token === null) {
            throw new NullValueException("Token cannot be null");
        }

        $token->updateExisting([
            'token' => $this->generateToken($this->config->get('app.key')),
        ]);

        $this->fireUpdatedEvent($token->user, $token);

        return $token;
    }
990937
public function getReset($token = null) {
        if (is_null($token))
        {
            throw new NotFoundHttpException;
        }

        //return view('usermanagement::auth.reset')->with('token', $token);
        return view('usermanagement::frontend.'.$this->frontend_template_name.'.password.reset', [
            'title' => 'Reset Password',
            'token' => $token,
        ]);
    }
881250
public function authenticatedUser($token = null)
    {
        $token = $this->getToken($token);

        $usersAPI = new Users($token);

        return $usersAPI->authenticatedUser();
    }
73144
protected function setAuthenticationHeader($response, $token = null)
    {
        $token = $token ?: $this->auth->refresh();
        $response->headers->set('Authorization', 'Bearer '.$token);

        return $response;
    }
858968
public function get($token)
    {
        foreach (
            $this->getEntityManager()->getConnection()->fetchAll(
                'SELECT * FROM oauth_access_token WHERE access_token=:token',
                ['token' => $token]
            ) as $row
        ) {
            return (new AccessTokenEntity($this->server))
                ->setId($row['access_token'])
                ->setExpireTime($row['expire_time']);
        };
        return null;
    }
628092
private function findUserByValidToken($token)
    {
        try {
            /** @var UserInterface $user */
            $user = $this->getUserRepository()->findUserByToken($token);
            if (new \DateTime() > $user->getPasswordResetTokenExpiresAt()) {
                throw new InvalidTokenException($token);
            }

            return $user;
        } catch (NoResultException $exc) {
            throw new InvalidTokenException($token);
        }
    }
179592
public function blocks($user, $token = null)
    {
        return $this->sendRequest('GET', 'users/'.$user.'/blocks', $this->getToken($token));
    }
1197389
public function getToken($token = null)
    {
        if ($token != null) {

            return $token;
        }

        if ($this->token == null) {

            throw new RequestRequiresAuthenticationException();
        }

        return $this->token;
    }
564287
public function setPasswordResetToken($token = '')
    {
        if (empty($this->passwordResetTokenAttribute) || !is_string($this->passwordResetTokenAttribute)) {
            return null;
        }
        return $this->{$this->passwordResetTokenAttribute} = $token;
    }
721959
protected function _put($token = null)
    {
        $entity = $this->_verify($this->_token($token));

        $subject = $this->_subject(compact('entity'));
        if ($this->_save($subject)) {
            return $this->_success($subject);
        }

        return $this->_error($subject);
    }
1112041
public function findUserByValidRefreshToken($token)
    {
        /** @var BaseUser $user */
        $user = $this->findOneBy(['refreshToken' => $token]);

        if (!empty($user) && $user->isRefreshTokenValid()) {
            return $user;
        }

        return null;
    }
258558
public function set($username, $token)
    {
        return apc_store($this->prefix.$username, $token, $this->ttl);
    }
383656
protected function _get($token = null)
    {
        $token = $this->_token($token);
        $entity = $this->_verify($token);

        if ($this->_save($entity)) {
            return $this->_success();
        }

        $this->_error();
    }
196943
protected function findUserByToken(Token $token)
    {
        // retrieves the user ID from the token.
        $id = $token->getClaim('sub');

        // use the users provider to find the token subject (user)
        // but it's id (subject)
        return $this->provider->retrieveById($id);
    }
534849
public function withToken(Token $token)
    {
        $card = $this->with('token', $token);

        if (null !== $card->number) {
            $lastDigits = strlen($card->number) <= 4
                ? $card->number :
                substr($card->number, -4);
            $card->number = "XXXX-XXXX-XXXX-" . $lastDigits;
        }

        $card->cvv = null;

        return $card;
    }