Package io.jmix.webdavrest.security
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 Summary
ConstructorDescriptionCookieAuthenticationToken
(Object principal, String cookieToken, String urlToken) CookieAuthenticationToken
(Object principal, String cookieToken, String urlToken, Collection<? extends org.springframework.security.core.GrantedAuthority> authorities) -
Method Summary
Modifier and TypeMethodDescriptionstatic CookieAuthenticationToken
authenticated
(Object principal, String cookieToken, String urlToken, Collection<? extends org.springframework.security.core.GrantedAuthority> authorities) Create a fully authenticated authentication tokenvoid
void
setAuthenticated
(boolean isAuthenticated) static CookieAuthenticationToken
unauthenticated
(Object principal, String cookieToken, String urlToken) Create an unauthenticated authentication tokenMethods inherited from class org.springframework.security.authentication.AbstractAuthenticationToken
equals, getAuthorities, getDetails, getName, hashCode, isAuthenticated, setDetails, toString
-
Constructor Details
-
CookieAuthenticationToken
-
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
- principalcookieToken
- cookie-token valueurlToken
- 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
- principalcookieToken
- cookie-token valueurlToken
- URL-token valueauthorities
- authorities- Returns:
- authenticated token object
-
getCredentials
-
getPrincipal
-
getUrlToken
-
getCookieToken
-
setAuthenticated
- Specified by:
setAuthenticated
in interfaceorg.springframework.security.core.Authentication
- Overrides:
setAuthenticated
in classorg.springframework.security.authentication.AbstractAuthenticationToken
- Throws:
IllegalArgumentException
-
eraseCredentials
public void eraseCredentials()- Specified by:
eraseCredentials
in interfaceorg.springframework.security.core.CredentialsContainer
- Overrides:
eraseCredentials
in classorg.springframework.security.authentication.AbstractAuthenticationToken
-