Class AuthPrincipalAuthenticationToken

java.lang.Object
org.springframework.security.authentication.AbstractAuthenticationToken
org.springframework.security.authentication.UsernamePasswordAuthenticationToken
io.leandev.appfuse.security.auth.AuthPrincipalAuthenticationToken
All Implemented Interfaces:
Serializable, Principal, org.springframework.security.core.Authentication, org.springframework.security.core.CredentialsContainer

public final class AuthPrincipalAuthenticationToken extends org.springframework.security.authentication.UsernamePasswordAuthenticationToken

已驗證 AuthPrincipal 的 Authentication adapter。

principal 保留完整 UserDetails 供 tenant resolver 等機制探詢;Authentication#getName() 則固定回穩定 subject,使 JWT、API key 與 Basic Auth 三種呈遞方式對應同一個主體識別。

See Also:
  • Nested Class Summary

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

    org.springframework.security.authentication.UsernamePasswordAuthenticationToken.Builder<B>

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

    org.springframework.security.authentication.AbstractAuthenticationToken.AbstractAuthenticationBuilder<B>
  • Method Summary

    Modifier and Type
    Method
    Description
    authenticated(AuthPrincipal principal, Object credentials)
     
     

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

    authenticated, eraseCredentials, getCredentials, getPrincipal, setAuthenticated, toBuilder, unauthenticated

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

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

    Methods inherited from class Object

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

    Methods inherited from interface Principal

    implies