You are here

public function Jwks::handle in Simple OAuth (OAuth2) & OpenID Connect 5.x

The controller.

Return value

\Symfony\Component\HttpFoundation\Response The response.

1 string reference to 'Jwks::handle'
simple_oauth.routing.yml in ./simple_oauth.routing.yml
simple_oauth.routing.yml

File

src/Controller/Jwks.php, line 63

Class

Jwks
Controller for the User Info endpoint.

Namespace

Drupal\simple_oauth\Controller

Code

public function handle() {
  if (!$this->user instanceof TokenAuthUser) {
    throw new AccessDeniedHttpException('This route is only available for authenticated requests using OAuth2.');
  }
  if ($this->config
    ->get('disable_openid_connect')) {
    throw new NotFoundHttpException('Not Found');
  }
  return JsonResponse::create((new JwksEntity())
    ->getKeys());
}