src/Authentication/OAuth2Adapter.php
/**
     * Attempt to authenticate the current request.
     *
     * @param Request $request
     * @param Response $response
     * @param MvcAuthEvent $mvcAuthEvent
     * @return false|Identity\IdentityInterface False on failure, IdentityInterface
     *     otherwise
     */
Attempt to authenticate the current request.
@param Request $request
@param Response $response
@param MvcAuthEvent $mvcAuthEvent
@return false|Identity\IdentityInterface False on failure, IdentityInterface
otherwise
Attempt to authenticate the current request . @param Request $request @param Response $response @param MvcAuthEvent $mvcAuthEvent @return false|Identity \ IdentityInterface False on failure IdentityInterface otherwise
public function authenticate(Request $request, Response $response, MvcAuthEvent $mvcAuthEvent)
    {
        $oauth2request = new OAuth2Request(
            $request->getQuery()->toArray(),
            $request->getPost()->toArray(),
            [],
            ($request->getCookie() ? $request->getCookie()->getArrayCopy() : []),
            ($request->getFiles() ? $request->getFiles()->toArray() : []),
            (method_exists($request, 'getServer') ? $request->getServer()->toArray() : $_SERVER),
            $request->getContent(),
            $request->getHeaders()->toArray()
        );
        $token = $this->oauth2Server->getAccessTokenData($oauth2request);
        if (! $token) {
            return $this->processInvalidToken($response);
        }
        $identity = new Identity\AuthenticatedIdentity($token);
        $identity->setName($token['user_id']);
        return $identity;
    }
public function authenticate ( Request $ request , Response $ response , MvcAuthEvent $ mvcAuthEvent ) { $ oauth2request = new OAuth2Request ( $ request -> getQuery ( ) -> toArray ( ) , $ request -> getPost ( ) -> toArray ( ) , [ ] , ( $ request -> getCookie ( ) ? $ request -> getCookie ( ) -> getArrayCopy ( ) : [ ] ) , ( $ request -> getFiles ( ) ? $ request -> getFiles ( ) -> toArray ( ) : [ ] ) , ( method_exists ( $ request , 'getServer' ) ? $ request -> getServer ( ) -> toArray ( ) : $ _SERVER ) , $ request -> getContent ( ) , $ request -> getHeaders ( ) -> toArray ( ) ) ; $ token = $ this -> oauth2Server -> getAccessTokenData ( $ oauth2request ) ; if ( ! $ token ) { return $ this -> processInvalidToken ( $ response ) ; } $ identity = new Identity \ AuthenticatedIdentity ( $ token ) ; $ identity -> setName ( $ token [ 'user_id' ] ) ; return $ identity ; }
Attempt to authenticate the current request.
Attempt to authenticate the current request .
// Failure to validate