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

    Constructors
    Constructor
    Description
    CustomOidcUser(Collection<? extends org.springframework.security.core.GrantedAuthority> authorities, org.springframework.security.oauth2.core.oidc.OidcIdToken idToken)
    Constructs a CustomOidcUser using the provided parameters.
    CustomOidcUser(Collection<? extends org.springframework.security.core.GrantedAuthority> authorities, org.springframework.security.oauth2.core.oidc.OidcIdToken idToken, String nameAttributeKey)
    Constructs a CustomOidcUser using 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 a CustomOidcUser using 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 a CustomOidcUser using the provided parameters.
  • Method Summary

    Modifier and Type
    Method
    Description
     
    org.springframework.security.oauth2.core.oidc.OidcIdToken
     
    org.springframework.security.oauth2.core.oidc.OidcUserInfo
     

    Methods inherited from class com.xebialabs.platform.sso.oidc.user.CustomOAuth2User

    equals, getAttributes, getAuthorities, getName, hashCode, toString

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.springframework.security.core.AuthenticatedPrincipal

    getName

    Methods inherited from interface org.springframework.security.oauth2.core.ClaimAccessor

    getClaim, getClaimAsBoolean, getClaimAsInstant, getClaimAsMap, getClaimAsString, getClaimAsStringList, getClaimAsURL, hasClaim

    Methods inherited from interface org.springframework.security.oauth2.core.oidc.IdTokenClaimAccessor

    getAccessTokenHash, getAudience, getAuthenticatedAt, getAuthenticationContextClass, getAuthenticationMethods, getAuthorizationCodeHash, getAuthorizedParty, getExpiresAt, getIssuedAt, getIssuer, getNonce, getSubject

    Methods inherited from interface org.springframework.security.oauth2.core.OAuth2AuthenticatedPrincipal

    getAttribute, getAttributes, getAuthorities

    Methods 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 a CustomOidcUser using the provided parameters.
      Parameters:
      authorities - the authorities granted to the user
      idToken - the ID Token containing 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 a CustomOidcUser using the provided parameters.
      Parameters:
      authorities - the authorities granted to the user
      idToken - the ID Token containing claims about the user
      nameAttributeKey - the key used to access the user's "name" from CustomOAuth2User.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 a CustomOidcUser using the provided parameters.
      Parameters:
      authorities - the authorities granted to the user
      idToken - the ID Token containing claims about the user
      userInfo - the UserInfo containing claims about the user, may be null
    • 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 a CustomOidcUser using the provided parameters.
      Parameters:
      authorities - the authorities granted to the user
      idToken - the ID Token containing claims about the user
      userInfo - the UserInfo containing claims about the user, may be null
      nameAttributeKey - the key used to access the user's "name" from CustomOAuth2User.getAttributes()
  • Method Details

    • getClaims

      public Map<String,Object> getClaims()
      Specified by:
      getClaims in interface org.springframework.security.oauth2.core.ClaimAccessor
      Specified by:
      getClaims in interface org.springframework.security.oauth2.core.oidc.user.OidcUser
    • getIdToken

      public org.springframework.security.oauth2.core.oidc.OidcIdToken getIdToken()
      Specified by:
      getIdToken in interface org.springframework.security.oauth2.core.oidc.user.OidcUser
    • getUserInfo

      public org.springframework.security.oauth2.core.oidc.OidcUserInfo getUserInfo()
      Specified by:
      getUserInfo in interface org.springframework.security.oauth2.core.oidc.user.OidcUser