Skip to content

Commit 7c45ebd

Browse files
committed
Polish gh-15012
1 parent 99aee99 commit 7c45ebd

File tree

7 files changed

+11
-10
lines changed

7 files changed

+11
-10
lines changed

oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/oidc/userinfo/OidcUserRequestUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -80,7 +80,7 @@ static OidcUser getUser(OidcUserRequest userRequest, OidcUserInfo userInfo) {
8080
Set<GrantedAuthority> authorities = new LinkedHashSet<>();
8181
ClientRegistration.ProviderDetails providerDetails = userRequest.getClientRegistration().getProviderDetails();
8282
String userNameAttributeName = providerDetails.getUserInfoEndpoint().getUserNameAttributeName();
83-
if (StringUtils.hasLength(userNameAttributeName)) {
83+
if (StringUtils.hasText(userNameAttributeName)) {
8484
authorities.add(new OidcUserAuthority(userRequest.getIdToken(), userInfo, userNameAttributeName));
8585
}
8686
else {

oauth2/oauth2-client/src/test/java/org/springframework/security/oauth2/client/jackson2/OAuth2AuthenticationTokenMixinTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2020 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

oauth2/oauth2-core/src/main/java/org/springframework/security/oauth2/core/oidc/user/OidcUserAuthority.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -19,6 +19,7 @@
1919
import java.util.HashMap;
2020
import java.util.Map;
2121

22+
import org.springframework.lang.Nullable;
2223
import org.springframework.security.core.GrantedAuthority;
2324
import org.springframework.security.oauth2.core.oidc.IdTokenClaimNames;
2425
import org.springframework.security.oauth2.core.oidc.OidcIdToken;
@@ -67,7 +68,7 @@ public OidcUserAuthority(OidcIdToken idToken, OidcUserInfo userInfo) {
6768
* @param userNameAttributeName the attribute name used to access the user's name from
6869
* the attributes
6970
*/
70-
public OidcUserAuthority(OidcIdToken idToken, OidcUserInfo userInfo, String userNameAttributeName) {
71+
public OidcUserAuthority(OidcIdToken idToken, OidcUserInfo userInfo, @Nullable String userNameAttributeName) {
7172
this("OIDC_USER", idToken, userInfo, userNameAttributeName);
7273
}
7374

@@ -92,7 +93,7 @@ public OidcUserAuthority(String authority, OidcIdToken idToken, OidcUserInfo use
9293
* the attributes
9394
*/
9495
public OidcUserAuthority(String authority, OidcIdToken idToken, OidcUserInfo userInfo,
95-
String userNameAttributeName) {
96+
@Nullable String userNameAttributeName) {
9697
super(authority, collectClaims(idToken, userInfo), userNameAttributeName);
9798
this.idToken = idToken;
9899
this.userInfo = userInfo;

oauth2/oauth2-core/src/main/java/org/springframework/security/oauth2/core/user/OAuth2UserAuthority.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

oauth2/oauth2-core/src/test/java/org/springframework/security/oauth2/core/user/TestOAuth2Users.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2020 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

test/src/main/java/org/springframework/security/test/web/reactive/server/SecurityMockServerConfigurers.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2023 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

test/src/main/java/org/springframework/security/test/web/servlet/request/SecurityMockMvcRequestPostProcessors.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2023 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)