Skip to content

Commit da8c105

Browse files
committed
added metadata about PKCE
1 parent 7c9064e commit da8c105

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</parent>
1010
<groupId>cz.metacentrum</groupId>
1111
<artifactId>fake_oidc</artifactId>
12-
<version>1.0</version>
12+
<version>1.1</version>
1313
<name>fake_oidc</name>
1414
<description>Fake OpenId Connect Authorization Server</description>
1515

src/main/java/cz/metacentrum/fake_oidc/OidcController.java

+3
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)