Use id field instead of name field for GitHub and Facebook providers.
Fixes gh-4764
This commit is contained in:
parent
881cd0befb
commit
06c4bffc5f
|
@ -58,7 +58,7 @@ public enum CommonOAuth2Provider {
|
|||
builder.authorizationUri("https://github.com/login/oauth/authorize");
|
||||
builder.tokenUri("https://github.com/login/oauth/access_token");
|
||||
builder.userInfoUri("https://api.github.com/user");
|
||||
builder.userNameAttributeName("name");
|
||||
builder.userNameAttributeName("id");
|
||||
builder.clientName("GitHub");
|
||||
return builder;
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ public enum CommonOAuth2Provider {
|
|||
builder.authorizationUri("https://www.facebook.com/v2.8/dialog/oauth");
|
||||
builder.tokenUri("https://graph.facebook.com/v2.8/oauth/access_token");
|
||||
builder.userInfoUri("https://graph.facebook.com/me");
|
||||
builder.userNameAttributeName("name");
|
||||
builder.userNameAttributeName("id");
|
||||
builder.clientName("Facebook");
|
||||
return builder;
|
||||
}
|
||||
|
|
|
@ -69,7 +69,7 @@ public class CommonOAuth2ProviderTests {
|
|||
assertThat(providerDetails.getUserInfoEndpoint().getUri())
|
||||
.isEqualTo("https://api.github.com/user");
|
||||
assertThat(providerDetails.getUserInfoEndpoint().getUserNameAttributeName())
|
||||
.isEqualTo("name");
|
||||
.isEqualTo("id");
|
||||
assertThat(providerDetails.getJwkSetUri()).isNull();
|
||||
assertThat(registration.getClientAuthenticationMethod())
|
||||
.isEqualTo(ClientAuthenticationMethod.BASIC);
|
||||
|
@ -92,7 +92,7 @@ public class CommonOAuth2ProviderTests {
|
|||
assertThat(providerDetails.getUserInfoEndpoint().getUri())
|
||||
.isEqualTo("https://graph.facebook.com/me");
|
||||
assertThat(providerDetails.getUserInfoEndpoint().getUserNameAttributeName())
|
||||
.isEqualTo("name");
|
||||
.isEqualTo("id");
|
||||
assertThat(providerDetails.getJwkSetUri()).isNull();
|
||||
assertThat(registration.getClientAuthenticationMethod())
|
||||
.isEqualTo(ClientAuthenticationMethod.POST);
|
||||
|
|
Loading…
Reference in New Issue