public function handle(GetResponseEvent $event)
    {
        $request = BridgeRequest::createFromRequest($event->getRequest());
        $response = new BridgeResponse;

        if (!$this->oauth2Server->verifyResourceRequest($request, $response)) {
            return;
        }

        try {
            $token = $this->oauth2Server->getAccessTokenData($request);
            $token = $this->authenticationManager->authenticate(
                new OAuth2Token(
                    $token['client_id'],
                    $token['user_id'],
                    $token['access_token'],
                    $this->providerKey,
                    [],
                    explode(" ", $token['scope'])
                )
            );
            $this->tokenStorage->setToken($token);
        } catch (AuthenticationException $failed) {
            $this->handleAuthenticationError($event, $request, $failed);
        }
    }
public function handle(GetResponseEvent $event)
    {
        $request = BridgeRequest::createFromRequest($event->getRequest());
        $response = new BridgeResponse;

        if (!$this->oauth2Server->verifyResourceRequest($request, $response)) {
            return;
        }

        try {
            $token = $this->oauth2Server->getAccessTokenData($request);
            $token = $this->authenticationManager->authenticate(
                new OAuth2Token(
                    $token['client_id'],
                    $token['user_id'],
                    $token['access_token'],
                    $this->providerKey,
                    [],
                    explode(" ", $token['scope'])
                )
            );
            $this->tokenStorage->setToken($token);
        } catch (AuthenticationException $failed) {
            $this->handleAuthenticationError($event, $request, $failed);
        }
    }
public function handle ( GetResponseEvent $ event ) { $ request = BridgeRequest :: createFromRequest ( $ event -> getRequest ( ) ) ; $ response = new BridgeResponse ; if ( ! $ this -> oauth2Server -> verifyResourceRequest ( $ request , $ response ) ) { return ; } try { $ token = $ this -> oauth2Server -> getAccessTokenData ( $ request ) ; $ token = $ this -> authenticationManager -> authenticate ( new OAuth2Token ( $ token [ 'client_id' ] , $ token [ 'user_id' ] , $ token [ 'access_token' ] , $ this -> providerKey , [ ] , explode ( " " , $ token [ 'scope' ] ) ) ) ; $ this -> tokenStorage -> setToken ( $ token ) ; } catch ( AuthenticationException $ failed ) { $ this -> handleAuthenticationError ( $ event , $ request , $ failed ) ; } }
Handles basic authentication.

@param GetResponseEvent $event A GetResponseEvent instance
Handles basic authentication .