|
@@ -1,5 +1,5 @@
|
|
|
/*
|
|
|
- * Copyright 2002-2022 the original author or authors.
|
|
|
+ * Copyright 2002-2024 the original author or authors.
|
|
|
*
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
* you may not use this file except in compliance with the License.
|
|
@@ -19,6 +19,7 @@ package org.springframework.security.oauth2.core.oidc.user;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.Map;
|
|
|
|
|
|
+import org.springframework.lang.Nullable;
|
|
|
import org.springframework.security.core.GrantedAuthority;
|
|
|
import org.springframework.security.oauth2.core.oidc.IdTokenClaimNames;
|
|
|
import org.springframework.security.oauth2.core.oidc.OidcIdToken;
|
|
@@ -67,7 +68,7 @@ public class OidcUserAuthority extends OAuth2UserAuthority {
|
|
|
* @param userNameAttributeName the attribute name used to access the user's name from
|
|
|
* the attributes
|
|
|
*/
|
|
|
- public OidcUserAuthority(OidcIdToken idToken, OidcUserInfo userInfo, String userNameAttributeName) {
|
|
|
+ public OidcUserAuthority(OidcIdToken idToken, OidcUserInfo userInfo, @Nullable String userNameAttributeName) {
|
|
|
this("OIDC_USER", idToken, userInfo, userNameAttributeName);
|
|
|
}
|
|
|
|
|
@@ -92,7 +93,7 @@ public class OidcUserAuthority extends OAuth2UserAuthority {
|
|
|
* the attributes
|
|
|
*/
|
|
|
public OidcUserAuthority(String authority, OidcIdToken idToken, OidcUserInfo userInfo,
|
|
|
- String userNameAttributeName) {
|
|
|
+ @Nullable String userNameAttributeName) {
|
|
|
super(authority, collectClaims(idToken, userInfo), userNameAttributeName);
|
|
|
this.idToken = idToken;
|
|
|
this.userInfo = userInfo;
|