Class CookieAuthenticationToken

java.lang.Object
org.springframework.security.authentication.AbstractAuthenticationToken
io.jmix.webdavrest.security.CookieAuthenticationToken
All Implemented Interfaces:
Serializable, Principal, org.springframework.security.core.Authentication, org.springframework.security.core.CredentialsContainer

public class CookieAuthenticationToken extends org.springframework.security.authentication.AbstractAuthenticationToken
Spring security authentication token that is used to perform authentication request via CookieAuthenticationProvider. Contains both URL-token and cookie-token.
See Also:
  • Constructor Details

    • CookieAuthenticationToken

      public CookieAuthenticationToken(Object principal, String cookieToken, String urlToken)
    • CookieAuthenticationToken

      public CookieAuthenticationToken(Object principal, String cookieToken, String urlToken, Collection<? extends org.springframework.security.core.GrantedAuthority> authorities)
  • Method Details

    • unauthenticated

      public static CookieAuthenticationToken unauthenticated(Object principal, String cookieToken, String urlToken)
      Create an unauthenticated authentication token
      Parameters:
      principal - principal
      cookieToken - cookie-token value
      urlToken - URL-token value
      Returns:
      unauthenticated token object
    • authenticated

      public static CookieAuthenticationToken authenticated(Object principal, String cookieToken, String urlToken, Collection<? extends org.springframework.security.core.GrantedAuthority> authorities)
      Create a fully authenticated authentication token
      Parameters:
      principal - principal
      cookieToken - cookie-token value
      urlToken - URL-token value
      authorities - authorities
      Returns:
      authenticated token object
    • getCredentials

      public Object getCredentials()
    • getPrincipal

      public Object getPrincipal()
    • getUrlToken

      public String getUrlToken()
    • getCookieToken

      public String getCookieToken()
    • setAuthenticated

      public void setAuthenticated(boolean isAuthenticated) throws IllegalArgumentException
      Specified by:
      setAuthenticated in interface org.springframework.security.core.Authentication
      Overrides:
      setAuthenticated in class org.springframework.security.authentication.AbstractAuthenticationToken
      Throws:
      IllegalArgumentException
    • eraseCredentials

      public void eraseCredentials()
      Specified by:
      eraseCredentials in interface org.springframework.security.core.CredentialsContainer
      Overrides:
      eraseCredentials in class org.springframework.security.authentication.AbstractAuthenticationToken