Deprecate ClientRegistration.redirectUriTemplate
Closes gh-8906
This commit is contained in:
@@ -156,7 +156,7 @@ public final class ClientRegistration {
|
||||
private String clientSecret; <3>
|
||||
private ClientAuthenticationMethod clientAuthenticationMethod; <4>
|
||||
private AuthorizationGrantType authorizationGrantType; <5>
|
||||
private String redirectUriTemplate; <6>
|
||||
private String redirectUri; <6>
|
||||
private Set<String> scopes; <7>
|
||||
private ProviderDetails providerDetails;
|
||||
private String clientName; <8>
|
||||
@@ -185,7 +185,7 @@ public final class ClientRegistration {
|
||||
The supported values are *basic*, *post* and *none* https://tools.ietf.org/html/rfc6749#section-2.1[(public clients)].
|
||||
<5> `authorizationGrantType`: The OAuth 2.0 Authorization Framework defines four https://tools.ietf.org/html/rfc6749#section-1.3[Authorization Grant] types.
|
||||
The supported values are `authorization_code`, `client_credentials` and `password`.
|
||||
<6> `redirectUriTemplate`: The client's registered redirect URI that the _Authorization Server_ redirects the end-user's user-agent
|
||||
<6> `redirectUri`: The client's registered redirect URI that the _Authorization Server_ redirects the end-user's user-agent
|
||||
to after the end-user has authenticated and authorized access to the client.
|
||||
<7> `scopes`: The scope(s) requested by the client during the Authorization Request flow, such as openid, email, or profile.
|
||||
<8> `clientName`: A descriptive name used for the client.
|
||||
|
||||
@@ -114,7 +114,7 @@ The following table outlines the mapping of the Spring Boot 2.x OAuth Client pro
|
||||
|`authorizationGrantType`
|
||||
|
||||
|`spring.security.oauth2.client.registration._[registrationId]_.redirect-uri`
|
||||
|`redirectUriTemplate`
|
||||
|`redirectUri`
|
||||
|
||||
|`spring.security.oauth2.client.registration._[registrationId]_.scope`
|
||||
|`scopes`
|
||||
@@ -266,7 +266,7 @@ public class OAuth2LoginConfig {
|
||||
.clientSecret("google-client-secret")
|
||||
.clientAuthenticationMethod(ClientAuthenticationMethod.BASIC)
|
||||
.authorizationGrantType(AuthorizationGrantType.AUTHORIZATION_CODE)
|
||||
.redirectUriTemplate("{baseUrl}/login/oauth2/code/{registrationId}")
|
||||
.redirectUri("{baseUrl}/login/oauth2/code/{registrationId}")
|
||||
.scope("openid", "profile", "email", "address", "phone")
|
||||
.authorizationUri("https://accounts.google.com/o/oauth2/v2/auth")
|
||||
.tokenUri("https://www.googleapis.com/oauth2/v4/token")
|
||||
@@ -360,7 +360,7 @@ public class OAuth2LoginConfig {
|
||||
.clientSecret("google-client-secret")
|
||||
.clientAuthenticationMethod(ClientAuthenticationMethod.BASIC)
|
||||
.authorizationGrantType(AuthorizationGrantType.AUTHORIZATION_CODE)
|
||||
.redirectUriTemplate("{baseUrl}/login/oauth2/code/{registrationId}")
|
||||
.redirectUri("{baseUrl}/login/oauth2/code/{registrationId}")
|
||||
.scope("openid", "profile", "email", "address", "phone")
|
||||
.authorizationUri("https://accounts.google.com/o/oauth2/v2/auth")
|
||||
.tokenUri("https://www.googleapis.com/oauth2/v4/token")
|
||||
@@ -403,7 +403,7 @@ class OAuth2LoginConfig {
|
||||
.clientSecret("google-client-secret")
|
||||
.clientAuthenticationMethod(ClientAuthenticationMethod.BASIC)
|
||||
.authorizationGrantType(AuthorizationGrantType.AUTHORIZATION_CODE)
|
||||
.redirectUriTemplate("{baseUrl}/login/oauth2/code/{registrationId}")
|
||||
.redirectUri("{baseUrl}/login/oauth2/code/{registrationId}")
|
||||
.scope("openid", "profile", "email", "address", "phone")
|
||||
.authorizationUri("https://accounts.google.com/o/oauth2/v2/auth")
|
||||
.tokenUri("https://www.googleapis.com/oauth2/v4/token")
|
||||
@@ -854,7 +854,7 @@ class OAuth2LoginSecurityConfig : WebSecurityConfigurerAdapter() {
|
||||
|
||||
[IMPORTANT]
|
||||
====
|
||||
You also need to ensure the `ClientRegistration.redirectUriTemplate` matches the custom Authorization Response `baseUri`.
|
||||
You also need to ensure the `ClientRegistration.redirectUri` matches the custom Authorization Response `baseUri`.
|
||||
|
||||
The following listing shows an example:
|
||||
|
||||
@@ -863,7 +863,7 @@ The following listing shows an example:
|
||||
return CommonOAuth2Provider.GOOGLE.getBuilder("google")
|
||||
.clientId("google-client-id")
|
||||
.clientSecret("google-client-secret")
|
||||
.redirectUriTemplate("{baseUrl}/login/oauth2/callback/{registrationId}")
|
||||
.redirectUri("{baseUrl}/login/oauth2/callback/{registrationId}")
|
||||
.build();
|
||||
----
|
||||
====
|
||||
|
||||
Reference in New Issue
Block a user