protocol = $protocol; $this->grant_type = new ValidateBearerTokenGrantType($client_service, $token_service, $auth_service, $log_service); } /** * @param OAuth2Request $request * @return mixed|\oauth2\responses\OAuth2AccessTokenValidationResponse|void * @throws InvalidOAuth2Request * @throws \oauth2\exceptions\BearerTokenDisclosureAttemptException * @throws \oauth2\exceptions\ExpiredAccessTokenException * @throws \oauth2\exceptions\InvalidApplicationType * @throws \oauth2\exceptions\InvalidOAuth2Request * @throws \oauth2\exceptions\LockedClientException */ public function handle(OAuth2Request $request) { if($this->grant_type->canHandle($request)) { return $this->grant_type->completeFlow($request); } throw new InvalidOAuth2Request; } }