public function authorize(IRequest $request, IUser $user)
    {
        // resolve grant type for current request
        $grantType = $this->grantTypeResolver->resolve($request);

        if (!$grantType instanceof IAuthorizationGrantType) {
            throw new UnsupportedResponseTypeException;
        }

        return $grantType->authorize($request, $user);
    }
public function authorize(IRequest $request, IUser $user)
    {
        // resolve grant type for current request
        $grantType = $this->grantTypeResolver->resolve($request);

        if (!$grantType instanceof IAuthorizationGrantType) {
            throw new UnsupportedResponseTypeException;
        }

        return $grantType->authorize($request, $user);
    }
public function authorize ( IRequest $ request , IUser $ user ) { // resolve grant type for current request $ grantType = $ this -> grantTypeResolver -> resolve ( $ request ) ; if ( ! $ grantType instanceof IAuthorizationGrantType ) { throw new UnsupportedResponseTypeException ; } return $ grantType -> authorize ( $ request , $ user ) ; }
Authorizes request using grant type with authorization

@param IRequest $request
@param IUser $user   logged user

@return IAuthorizationSession
@throws \OAuth2\Exception\UnsupportedResponseTypeException
Authorizes request using grant type with authorization