diff --git a/src/Laravel/DiscoveryController.php b/src/Laravel/DiscoveryController.php index e6dd271..cd17041 100644 --- a/src/Laravel/DiscoveryController.php +++ b/src/Laravel/DiscoveryController.php @@ -13,7 +13,6 @@ public function __invoke(Request $request) 'issuer' => url('/'), 'authorization_endpoint' => route('passport.authorizations.authorize'), 'token_endpoint' => route('passport.token'), - 'jwks_uri' => route('openid.jwks'), 'response_types_supported' => [ 'code', 'token', @@ -41,6 +40,10 @@ public function __invoke(Request $request) $response['userinfo_endpoint'] = route('openid.userinfo'); } + if (Route::has('openid.jwks')) { + $response['jwks_uri'] = route('openid.jwks'); + } + return response()->json($response, 200, [], JSON_PRETTY_PRINT); } }