Skip to content

Commit 5fe955a

Browse files
drunkcatttjgrandja
authored andcommitted
Add code challenge methods for oidc provider configuration response
Closes gh-1302
1 parent 3eb951f commit 5fe955a

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/oidc/web/OidcProviderConfigurationEndpointFilter.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ protected void doFilterInternal(HttpServletRequest request, HttpServletResponse
109109
.tokenRevocationEndpointAuthenticationMethods(clientAuthenticationMethods())
110110
.tokenIntrospectionEndpoint(asUrl(issuer, authorizationServerSettings.getTokenIntrospectionEndpoint()))
111111
.tokenIntrospectionEndpointAuthenticationMethods(clientAuthenticationMethods())
112+
.codeChallengeMethod("S256")
112113
.subjectType("public")
113114
.idTokenSigningAlgorithm(SignatureAlgorithm.RS256.getName())
114115
.scope(OidcScopes.OPENID);

oauth2-authorization-server/src/test/java/org/springframework/security/oauth2/server/authorization/config/annotation/web/configurers/OidcProviderConfigurationTests.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ private ResultMatcher[] defaultConfigurationMatchers() {
141141
jsonPath("$.introspection_endpoint_auth_methods_supported[1]").value(ClientAuthenticationMethod.CLIENT_SECRET_POST.getValue()),
142142
jsonPath("$.introspection_endpoint_auth_methods_supported[2]").value(ClientAuthenticationMethod.CLIENT_SECRET_JWT.getValue()),
143143
jsonPath("$.introspection_endpoint_auth_methods_supported[3]").value(ClientAuthenticationMethod.PRIVATE_KEY_JWT.getValue()),
144+
jsonPath("$.code_challenge_methods_supported[0]").value("S256"),
144145
jsonPath("subject_types_supported").value("public"),
145146
jsonPath("id_token_signing_alg_values_supported").value(SignatureAlgorithm.RS256.getName()),
146147
jsonPath("scopes_supported").value(OidcScopes.OPENID)

oauth2-authorization-server/src/test/java/org/springframework/security/oauth2/server/authorization/oidc/web/OidcProviderConfigurationEndpointFilterTests.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ public void doFilterWhenConfigurationRequestThenConfigurationResponse() throws E
131131
assertThat(providerConfigurationResponse).contains("\"revocation_endpoint_auth_methods_supported\":[\"client_secret_basic\",\"client_secret_post\",\"client_secret_jwt\",\"private_key_jwt\"]");
132132
assertThat(providerConfigurationResponse).contains("\"introspection_endpoint\":\"https://example.com/issuer1/oauth2/v1/introspect\"");
133133
assertThat(providerConfigurationResponse).contains("\"introspection_endpoint_auth_methods_supported\":[\"client_secret_basic\",\"client_secret_post\",\"client_secret_jwt\",\"private_key_jwt\"]");
134+
assertThat(providerConfigurationResponse).contains("\"code_challenge_methods_supported\":[\"S256\"]");
134135
assertThat(providerConfigurationResponse).contains("\"subject_types_supported\":[\"public\"]");
135136
assertThat(providerConfigurationResponse).contains("\"id_token_signing_alg_values_supported\":[\"RS256\"]");
136137
assertThat(providerConfigurationResponse).contains("\"userinfo_endpoint\":\"https://example.com/issuer1/userinfo\"");

0 commit comments

Comments
 (0)