java.lang.Object
org.springframework.security.authentication.AbstractAuthenticationToken
com.irurueta.authserver.serviceclient.infrastructure.resourceserver.SubjectTokenAuthentication
All Implemented Interfaces:
Serializable, Principal, org.springframework.security.core.Authentication, org.springframework.security.core.CredentialsContainer

public class SubjectTokenAuthentication extends org.springframework.security.authentication.AbstractAuthenticationToken
The user a token exchange acts for: the principal is the user's access token, which is what Spring Security's token exchange provider reads as the subject token, and the name is what the authorized clients are cached under.
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.springframework.security.authentication.AbstractAuthenticationToken

    org.springframework.security.authentication.AbstractAuthenticationToken.AbstractAuthenticationBuilder<B extends org.springframework.security.authentication.AbstractAuthenticationToken.AbstractAuthenticationBuilder<B>>

    Nested classes/interfaces inherited from interface org.springframework.security.core.Authentication

    org.springframework.security.core.Authentication.Builder<B extends org.springframework.security.core.Authentication.Builder<B>>
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final String
    Name the exchanged token is cached under.
    private static final long
    Serialization version.
    private final org.springframework.security.oauth2.core.OAuth2AccessToken
    The user's access token.
  • Constructor Summary

    Constructors
    Constructor
    Description
    SubjectTokenAuthentication(org.springframework.security.oauth2.core.OAuth2AccessToken subjectToken, String name)
    Creates the authentication.
  • Method Summary

    Modifier and Type
    Method
    Description
     
     
     

    Methods inherited from class org.springframework.security.authentication.AbstractAuthenticationToken

    equals, eraseCredentials, getAuthorities, getDetails, hashCode, isAuthenticated, setAuthenticated, setDetails, toString

    Methods inherited from class java.lang.Object

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

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

    toBuilder

    Methods inherited from interface java.security.Principal

    implies
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      Serialization version.
      See Also:
    • subjectToken

      private final org.springframework.security.oauth2.core.OAuth2AccessToken subjectToken
      The user's access token.
    • name

      private final String name
      Name the exchanged token is cached under.
  • Constructor Details

    • SubjectTokenAuthentication

      public SubjectTokenAuthentication(org.springframework.security.oauth2.core.OAuth2AccessToken subjectToken, String name)
      Creates the authentication.
      Parameters:
      subjectToken - the user's access token.
      name - name the exchanged token is cached under; it must differ for different subject tokens.
  • Method Details

    • getCredentials

      public Object getCredentials()
    • getPrincipal

      public Object getPrincipal()
    • getName

      public String getName()
      Specified by:
      getName in interface Principal
      Overrides:
      getName in class org.springframework.security.authentication.AbstractAuthenticationToken