/** * {@inheritdoc} */ public function check(OAuth2Token $token, OAuth2 $configuration) { if (null === $configuration->getClientType()) { return; } if (self::TYPE_PUBLIC === $configuration->getClientType() && 'none' === $token->getClient()->get('token_endpoint_auth_method')) { return; } if (self::TYPE_CONFIDENTIAL === $configuration->getClientType() && 'none' !== $token->getClient()->get('token_endpoint_auth_method')) { return; } return 'Resource owner not authorized.'; }
/** * {@inheritdoc} */ public function check(OAuth2Token $token, OAuth2 $configuration) { if (null === $configuration->getClientPublicId()) { return; } if ($configuration->getClientPublicId() !== $token->getClient()->getPublicId()) { return 'Client not authorized.'; } }
/** * {@inheritdoc} */ public function check(OAuth2Token $token, OAuth2 $configuration) { if (null === $configuration->getClientType()) { return; } $result = $this->isTypeValid($configuration->getClientType(), $token->getClient()); if (false === $result) { return 'Bad client type'; } }