mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-06-22 20:12:14 +00:00
Add Twitter/X to CommonOAuth2Provider
Add Twitter/X to CommonOAuth2Provider
This commit is contained in:
commit
ff8b77df29
@ -87,6 +87,23 @@ public enum CommonOAuth2Provider {
|
||||
|
||||
},
|
||||
|
||||
X {
|
||||
|
||||
@Override
|
||||
public Builder getBuilder(String registrationId) {
|
||||
ClientRegistration.Builder builder = getBuilder(registrationId,
|
||||
ClientAuthenticationMethod.CLIENT_SECRET_POST, DEFAULT_REDIRECT_URL);
|
||||
builder.scope("users.read", "tweet.read");
|
||||
builder.authorizationUri("https://x.com/i/oauth2/authorize");
|
||||
builder.tokenUri("https://api.x.com/2/oauth2/token");
|
||||
builder.userInfoUri("https://api.x.com/2/users/me");
|
||||
builder.userNameAttributeName("username");
|
||||
builder.clientName("X");
|
||||
return builder;
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
OKTA {
|
||||
|
||||
@Override
|
||||
|
@ -153,7 +153,7 @@ A `ClientRegistration` can be initially configured using discovery of an OpenID
|
||||
[[webflux-oauth2-login-common-oauth2-provider]]
|
||||
== CommonOAuth2Provider
|
||||
|
||||
`CommonOAuth2Provider` pre-defines a set of default client properties for a number of well known providers: Google, GitHub, Facebook, and Okta.
|
||||
`CommonOAuth2Provider` pre-defines a set of default client properties for a number of well known providers: Google, GitHub, Facebook, X, and Okta.
|
||||
|
||||
For example, the `authorization-uri`, `token-uri`, and `user-info-uri` do not change often for a Provider.
|
||||
Therefore, it makes sense to provide default values in order to reduce the required configuration.
|
||||
|
@ -153,7 +153,7 @@ You can initially configure a `ClientRegistration` by using discovery of an Open
|
||||
[[oauth2login-common-oauth2-provider]]
|
||||
== CommonOAuth2Provider
|
||||
|
||||
`CommonOAuth2Provider` pre-defines a set of default client properties for a number of well known providers: Google, GitHub, Facebook, and Okta.
|
||||
`CommonOAuth2Provider` pre-defines a set of default client properties for a number of well known providers: Google, GitHub, Facebook, X, and Okta.
|
||||
|
||||
For example, the `authorization-uri`, `token-uri`, and `user-info-uri` do not change often for a provider.
|
||||
Therefore, it makes sense to provide default values, to reduce the required configuration.
|
||||
|
Loading…
x
Reference in New Issue
Block a user