@@ -51,34 +51,68 @@ public class DefaultOidcUser extends DefaultOAuth2User implements OidcUser {
5151 * @param authorities the authorities granted to the user
5252 * @param idToken the {@link OidcIdToken ID Token} containing claims about the user
5353 */
54+ @ Deprecated
5455 public DefaultOidcUser (Collection <? extends GrantedAuthority > authorities , OidcIdToken idToken ) {
5556 this (authorities , idToken , IdTokenClaimNames .SUB );
5657 }
5758
59+ /**
60+ * Constructs a {@code DefaultOidcUser} using the provided parameters.
61+ * @param idToken the {@link OidcIdToken ID Token} containing claims about the user
62+ * @param authorities the authorities granted to the user
63+ */
64+ public DefaultOidcUser (OidcIdToken idToken , Collection <? extends GrantedAuthority > authorities ) {
65+ this (null , idToken , authorities );
66+ }
67+
5868 /**
5969 * Constructs a {@code DefaultOidcUser} using the provided parameters.
6070 * @param authorities the authorities granted to the user
6171 * @param idToken the {@link OidcIdToken ID Token} containing claims about the user
6272 * @param nameAttributeKey the key used to access the user's "name" from
6373 * {@link #getAttributes()}
6474 */
75+ @ Deprecated
6576 public DefaultOidcUser (Collection <? extends GrantedAuthority > authorities , OidcIdToken idToken ,
6677 String nameAttributeKey ) {
6778 this (authorities , idToken , null , nameAttributeKey );
6879 }
6980
81+ /**
82+ * Constructs a {@code DefaultOidcUser} using the provided parameters.
83+ * @param name the name of the user
84+ * @param idToken the {@link OidcIdToken ID Token} containing claims about the user
85+ * @param authorities the authorities granted to the user
86+ */
87+ public DefaultOidcUser (String name , OidcIdToken idToken , Collection <? extends GrantedAuthority > authorities ) {
88+ this (name , idToken , null , authorities );
89+ }
90+
7091 /**
7192 * Constructs a {@code DefaultOidcUser} using the provided parameters.
7293 * @param authorities the authorities granted to the user
7394 * @param idToken the {@link OidcIdToken ID Token} containing claims about the user
7495 * @param userInfo the {@link OidcUserInfo UserInfo} containing claims about the user,
7596 * may be {@code null}
7697 */
98+ @ Deprecated
7799 public DefaultOidcUser (Collection <? extends GrantedAuthority > authorities , OidcIdToken idToken ,
78100 OidcUserInfo userInfo ) {
79101 this (authorities , idToken , userInfo , IdTokenClaimNames .SUB );
80102 }
81103
104+ /**
105+ * Constructs a {@code DefaultOidcUser} using the provided parameters.
106+ * @param authorities the authorities granted to the user
107+ * @param idToken the {@link OidcIdToken ID Token} containing claims about the user
108+ * @param userInfo the {@link OidcUserInfo UserInfo} containing claims about the user,
109+ * may be {@code null}
110+ */
111+ public DefaultOidcUser (OidcIdToken idToken , OidcUserInfo userInfo ,
112+ Collection <? extends GrantedAuthority > authorities ) {
113+ this (null , idToken , userInfo , authorities );
114+ }
115+
82116 /**
83117 * Constructs a {@code DefaultOidcUser} using the provided parameters.
84118 * @param authorities the authorities granted to the user
@@ -88,13 +122,29 @@ public DefaultOidcUser(Collection<? extends GrantedAuthority> authorities, OidcI
88122 * @param nameAttributeKey the key used to access the user's "name" from
89123 * {@link #getAttributes()}
90124 */
125+ @ Deprecated
91126 public DefaultOidcUser (Collection <? extends GrantedAuthority > authorities , OidcIdToken idToken ,
92127 OidcUserInfo userInfo , String nameAttributeKey ) {
93128 super (authorities , OidcUserAuthority .collectClaims (idToken , userInfo ), nameAttributeKey );
94129 this .idToken = idToken ;
95130 this .userInfo = userInfo ;
96131 }
97132
133+ /**
134+ * Constructs a {@code DefaultOidcUser} using the provided parameters.
135+ * @param name the name of the user
136+ * @param idToken the {@link OidcIdToken ID Token} containing claims about the user
137+ * @param userInfo the {@link OidcUserInfo UserInfo} containing claims about the user,
138+ * may be {@code null}
139+ * @param authorities the authorities granted to the user
140+ */
141+ public DefaultOidcUser (String name , OidcIdToken idToken , OidcUserInfo userInfo ,
142+ Collection <? extends GrantedAuthority > authorities ) {
143+ super (name , OidcUserAuthority .collectClaims (idToken , userInfo ), authorities );
144+ this .idToken = idToken ;
145+ this .userInfo = userInfo ;
146+ }
147+
98148 @ Override
99149 public Map <String , Object > getClaims () {
100150 return this .getAttributes ();
0 commit comments