Class OidcUserAuthority

java.lang.Object
org.springframework.security.oauth2.core.user.OAuth2UserAuthority
org.springframework.security.oauth2.core.oidc.user.OidcUserAuthority
All Implemented Interfaces:
Serializable, GrantedAuthority

public class OidcUserAuthority extends OAuth2UserAuthority
A GrantedAuthority that may be associated to an OidcUser.
Since:
5.0
See Also:
  • Constructor Details

    • OidcUserAuthority

      public OidcUserAuthority(OidcIdToken idToken)
      Constructs a OidcUserAuthority using the provided parameters.
      Parameters:
      idToken - the ID Token containing claims about the user
    • OidcUserAuthority

      public OidcUserAuthority(OidcIdToken idToken, OidcUserInfo userInfo)
      Constructs a OidcUserAuthority using the provided parameters and defaults OAuth2UserAuthority.getAuthority() to OIDC_USER.
      Parameters:
      idToken - the ID Token containing claims about the user
      userInfo - the UserInfo containing claims about the user, may be null
    • OidcUserAuthority

      public OidcUserAuthority(String authority, OidcIdToken idToken, OidcUserInfo userInfo)
      Constructs a OidcUserAuthority using the provided parameters.
      Parameters:
      authority - the authority granted to the user
      idToken - the ID Token containing claims about the user
      userInfo - the UserInfo containing claims about the user, may be null
  • Method Details