public function isValidRequest($headerOnly = true, $accessToken = null)
    {
        $accessTokenString = ($accessToken !== null)
                                ? $accessToken
                                : $this->determineAccessToken($headerOnly);

        // Set the access token
        $this->accessToken = $this->getAccessTokenStorage()->get($accessTokenString);

        // Ensure the access token exists
        if (!$this->accessToken instanceof AccessTokenEntity) {
            throw new AccessDeniedException();
        }

        // Check the access token hasn't expired
        // Ensure the auth code hasn't expired
        if ($this->accessToken->isExpired() === true) {
            throw new AccessDeniedException();
        }

        return true;
    }
public function isValidRequest($headerOnly = true, $accessToken = null)
    {
        $accessTokenString = ($accessToken !== null)
                                ? $accessToken
                                : $this->determineAccessToken($headerOnly);

        // Set the access token
        $this->accessToken = $this->getAccessTokenStorage()->get($accessTokenString);

        // Ensure the access token exists
        if (!$this->accessToken instanceof AccessTokenEntity) {
            throw new AccessDeniedException();
        }

        // Check the access token hasn't expired
        // Ensure the auth code hasn't expired
        if ($this->accessToken->isExpired() === true) {
            throw new AccessDeniedException();
        }

        return true;
    }
public function isValidRequest ( $ headerOnly = true , $ accessToken = null ) { $ accessTokenString = ( $ accessToken !== null ) ? $ accessToken : $ this -> determineAccessToken ( $ headerOnly ) ; // Set the access token $ this -> accessToken = $ this -> getAccessTokenStorage ( ) -> get ( $ accessTokenString ) ; // Ensure the access token exists if ( ! $ this -> accessToken instanceof AccessTokenEntity ) { throw new AccessDeniedException ( ) ; } // Check the access token hasn't expired // Ensure the auth code hasn't expired if ( $ this -> accessToken -> isExpired ( ) === true ) { throw new AccessDeniedException ( ) ; } return true ; }
Checks if the access token is valid or not

@param bool                                                $headerOnly Limit Access Token to Authorization header
@param \OAuth2\Server\Entity\AccessTokenEntity|null $accessToken Access Token

@throws \OAuth2\Server\Exception\AccessDeniedException
@throws \OAuth2\Server\Exception\InvalidRequestException

@return bool
Checks if the access token is valid or not