public function authenticate(IRequest $request)
    {
        // resolve token type from request
        $tokenType = $this->tokenTypeResolver->resolve($request);

        $accessToken = $this->accessTokenStorage->get($tokenType->getAccessToken());

        if (!$accessToken) {
            throw new NotAuthenticatedException;
        }

        return new Session($accessToken);
    }
public function authenticate(IRequest $request)
    {
        // resolve token type from request
        $tokenType = $this->tokenTypeResolver->resolve($request);

        $accessToken = $this->accessTokenStorage->get($tokenType->getAccessToken());

        if (!$accessToken) {
            throw new NotAuthenticatedException;
        }

        return new Session($accessToken);
    }
public function authenticate ( IRequest $ request ) { // resolve token type from request $ tokenType = $ this -> tokenTypeResolver -> resolve ( $ request ) ; $ accessToken = $ this -> accessTokenStorage -> get ( $ tokenType -> getAccessToken ( ) ) ; if ( ! $ accessToken ) { throw new NotAuthenticatedException ; } return new Session ( $ accessToken ) ; }
Authenticates current request and returns session

@param IRequest $request

@throws \OAuth2\Exception\NotAuthenticatedException
@return Session
Authenticates current request and returns session