Class CustomOidcUser
java.lang.Object
com.xebialabs.platform.sso.oidc.user.CustomOAuth2User
com.xebialabs.platform.sso.oidc.user.CustomOidcUser
- All Implemented Interfaces:
Serializable,org.springframework.security.core.AuthenticatedPrincipal,org.springframework.security.oauth2.core.ClaimAccessor,org.springframework.security.oauth2.core.OAuth2AuthenticatedPrincipal,org.springframework.security.oauth2.core.oidc.IdTokenClaimAccessor,org.springframework.security.oauth2.core.oidc.StandardClaimAccessor,org.springframework.security.oauth2.core.oidc.user.OidcUser,org.springframework.security.oauth2.core.user.OAuth2User
public class CustomOidcUser
extends CustomOAuth2User
implements org.springframework.security.oauth2.core.oidc.user.OidcUser
Custom class which is replica of the
DefaultOidcUser
Once https://github.com/spring-projects/spring-security/issues/9366 is addressed, this class can be removed.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCustomOidcUser(Collection<? extends org.springframework.security.core.GrantedAuthority> authorities, org.springframework.security.oauth2.core.oidc.OidcIdToken idToken) Constructs aCustomOidcUserusing the provided parameters.CustomOidcUser(Collection<? extends org.springframework.security.core.GrantedAuthority> authorities, org.springframework.security.oauth2.core.oidc.OidcIdToken idToken, String nameAttributeKey) Constructs aCustomOidcUserusing the provided parameters.CustomOidcUser(Collection<? extends org.springframework.security.core.GrantedAuthority> authorities, org.springframework.security.oauth2.core.oidc.OidcIdToken idToken, org.springframework.security.oauth2.core.oidc.OidcUserInfo userInfo) Constructs aCustomOidcUserusing the provided parameters.CustomOidcUser(Collection<? extends org.springframework.security.core.GrantedAuthority> authorities, org.springframework.security.oauth2.core.oidc.OidcIdToken idToken, org.springframework.security.oauth2.core.oidc.OidcUserInfo userInfo, String nameAttributeKey) Constructs aCustomOidcUserusing the provided parameters. -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.security.oauth2.core.oidc.OidcIdTokenorg.springframework.security.oauth2.core.oidc.OidcUserInfoMethods inherited from class com.xebialabs.platform.sso.oidc.user.CustomOAuth2User
equals, getAttributes, getAuthorities, getName, hashCode, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.security.core.AuthenticatedPrincipal
getNameMethods inherited from interface org.springframework.security.oauth2.core.ClaimAccessor
getClaim, getClaimAsBoolean, getClaimAsInstant, getClaimAsMap, getClaimAsString, getClaimAsStringList, getClaimAsURL, hasClaimMethods inherited from interface org.springframework.security.oauth2.core.oidc.IdTokenClaimAccessor
getAccessTokenHash, getAudience, getAuthenticatedAt, getAuthenticationContextClass, getAuthenticationMethods, getAuthorizationCodeHash, getAuthorizedParty, getExpiresAt, getIssuedAt, getIssuer, getNonce, getSubjectMethods inherited from interface org.springframework.security.oauth2.core.OAuth2AuthenticatedPrincipal
getAttribute, getAttributes, getAuthoritiesMethods inherited from interface org.springframework.security.oauth2.core.oidc.StandardClaimAccessor
getAddress, getBirthdate, getEmail, getEmailVerified, getFamilyName, getFullName, getGender, getGivenName, getLocale, getMiddleName, getNickName, getPhoneNumber, getPhoneNumberVerified, getPicture, getPreferredUsername, getProfile, getUpdatedAt, getWebsite, getZoneInfo
-
Constructor Details
-
CustomOidcUser
public CustomOidcUser(Collection<? extends org.springframework.security.core.GrantedAuthority> authorities, org.springframework.security.oauth2.core.oidc.OidcIdToken idToken) Constructs aCustomOidcUserusing the provided parameters.- Parameters:
authorities- the authorities granted to the useridToken- theID Tokencontaining claims about the user
-
CustomOidcUser
public CustomOidcUser(Collection<? extends org.springframework.security.core.GrantedAuthority> authorities, org.springframework.security.oauth2.core.oidc.OidcIdToken idToken, String nameAttributeKey) Constructs aCustomOidcUserusing the provided parameters.- Parameters:
authorities- the authorities granted to the useridToken- theID Tokencontaining claims about the usernameAttributeKey- the key used to access the user's "name" fromCustomOAuth2User.getAttributes()
-
CustomOidcUser
public CustomOidcUser(Collection<? extends org.springframework.security.core.GrantedAuthority> authorities, org.springframework.security.oauth2.core.oidc.OidcIdToken idToken, org.springframework.security.oauth2.core.oidc.OidcUserInfo userInfo) Constructs aCustomOidcUserusing the provided parameters.- Parameters:
authorities- the authorities granted to the useridToken- theID Tokencontaining claims about the useruserInfo- theUserInfocontaining claims about the user, may benull
-
CustomOidcUser
public CustomOidcUser(Collection<? extends org.springframework.security.core.GrantedAuthority> authorities, org.springframework.security.oauth2.core.oidc.OidcIdToken idToken, org.springframework.security.oauth2.core.oidc.OidcUserInfo userInfo, String nameAttributeKey) Constructs aCustomOidcUserusing the provided parameters.- Parameters:
authorities- the authorities granted to the useridToken- theID Tokencontaining claims about the useruserInfo- theUserInfocontaining claims about the user, may benullnameAttributeKey- the key used to access the user's "name" fromCustomOAuth2User.getAttributes()
-
-
Method Details
-
getClaims
- Specified by:
getClaimsin interfaceorg.springframework.security.oauth2.core.ClaimAccessor- Specified by:
getClaimsin interfaceorg.springframework.security.oauth2.core.oidc.user.OidcUser
-
getIdToken
public org.springframework.security.oauth2.core.oidc.OidcIdToken getIdToken()- Specified by:
getIdTokenin interfaceorg.springframework.security.oauth2.core.oidc.user.OidcUser
-
getUserInfo
public org.springframework.security.oauth2.core.oidc.OidcUserInfo getUserInfo()- Specified by:
getUserInfoin interfaceorg.springframework.security.oauth2.core.oidc.user.OidcUser
-