Expose user name attribute name in OAuth2UserAuthority
This commit is contained in:
committed by
Steve Riesenberg
parent
b41ec0ae4b
commit
99aee99b34
@@ -834,7 +834,7 @@ public final class SecurityMockServerConfigurers {
|
||||
|
||||
private Collection<GrantedAuthority> defaultAuthorities() {
|
||||
Set<GrantedAuthority> authorities = new LinkedHashSet<>();
|
||||
authorities.add(new OAuth2UserAuthority(this.attributes.get()));
|
||||
authorities.add(new OAuth2UserAuthority(this.attributes.get(), this.nameAttributeKey));
|
||||
for (String authority : this.accessToken.getScopes()) {
|
||||
authorities.add(new SimpleGrantedAuthority("SCOPE_" + authority));
|
||||
}
|
||||
|
||||
@@ -1376,7 +1376,7 @@ public final class SecurityMockMvcRequestPostProcessors {
|
||||
|
||||
private Collection<GrantedAuthority> defaultAuthorities() {
|
||||
Set<GrantedAuthority> authorities = new LinkedHashSet<>();
|
||||
authorities.add(new OAuth2UserAuthority(this.attributes.get()));
|
||||
authorities.add(new OAuth2UserAuthority(this.attributes.get(), this.nameAttributeKey));
|
||||
for (String authority : this.accessToken.getScopes()) {
|
||||
authorities.add(new SimpleGrantedAuthority("SCOPE_" + authority));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user