@@ -99,6 +99,7 @@ public ResponseEntity<?> metadata(UriComponentsBuilder uriBuilder, HttpServletRe
9999 String urlPrefix = uriBuilder .replacePath (null ).build ().encode ().toUriString ();
100100 Map <String , Object > m = new LinkedHashMap <>();
101101 // https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata
102+ // https://tools.ietf.org/html/rfc8414#section-2
102103 m .put ("issuer" , urlPrefix + "/" ); // REQUIRED
103104 m .put ("authorization_endpoint" , urlPrefix + AUTHORIZATION_ENDPOINT ); // REQUIRED
104105 m .put ("token_endpoint" , urlPrefix + TOKEN_ENDPOINT ); // REQUIRED unless only the Implicit Flow is used
@@ -107,9 +108,11 @@ public ResponseEntity<?> metadata(UriComponentsBuilder uriBuilder, HttpServletRe
107108 m .put ("introspection_endpoint" , urlPrefix + INTROSPECTION_ENDPOINT );
108109 m .put ("scopes_supported" , Arrays .asList ("openid" , "profile" , "email" )); // RECOMMENDED
109110 m .put ("response_types_supported" , Arrays .asList ("id_token token" , "code" )); // REQUIRED
111+ m .put ("grant_types_supported" , Arrays .asList ("authorization_code" , "implicit" )); //OPTIONAL
110112 m .put ("subject_types_supported" , Collections .singletonList ("public" )); // REQUIRED
111113 m .put ("id_token_signing_alg_values_supported" , Arrays .asList ("RS256" , "none" )); // REQUIRED
112114 m .put ("claims_supported" , Arrays .asList ("sub" , "iss" , "name" , "family_name" , "given_name" , "preferred_username" , "email" ));
115+ m .put ("code_challenge_methods_supported" , Arrays .asList ("plain" , "S256" )); // PKCE support advertised
113116 return ResponseEntity .ok ().body (m );
114117 }
115118
0 commit comments