Package io.jmix.webdavrest.security
Class CookieAuthenticationRegistry
java.lang.Object
io.jmix.webdavrest.security.CookieAuthenticationRegistry
Manages both types of tokens (URl, Cookie) being used for cookie auth method.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected CookieAuthTokenObjectRepositoryprotected CookieAuthUrlTokenObjectRepositoryprotected UserRepositoryprotected WebdavProperties
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionacquireCookieTokenByUrlToken(String urlTokenValue) Generates cookie-token object based on valid URL-token value.protected StringGenerates new URL-token based on currently authenticated session.protected StringgetPrincipalByCookieToken(String tokenValue) Extracts UserDetails by cookie-token value.booleanisCookieTokenValid(String tokenValue) Validates cookie-token according to existence and expiration time.booleanisUrlTokenValid(String tokenValue) Validates URL-token.
- 
Field Details- 
userRepository
- 
cookieAuthUrlTokenObjectRepository
- 
cookieAuthTokenObjectRepository
- 
webdavProperties
 
- 
- 
Constructor Details- 
CookieAuthenticationRegistrypublic CookieAuthenticationRegistry()
 
- 
- 
Method Details- 
isUrlTokenValidValidates URL-token. URL-token is a one-time short-term token, so it's valid if it exists.- Parameters:
- tokenValue- token value extracted from request URL
- Returns:
- true if token is valid, false otherwise
 
- 
isCookieTokenValidValidates cookie-token according to existence and expiration time.- Parameters:
- tokenValue- token value extracted from cookie
- Returns:
- true if token is valid, false otherwise
 
- 
getPrincipalByCookieTokenExtracts UserDetails by cookie-token value. Username is linked with cookie-token value during its generation- Parameters:
- tokenValue- token value extracted from cookie
- Returns:
- principal object
 
- 
generateUrlTokenGenerates new URL-token based on currently authenticated session.- Returns:
- URL-token value
 
- 
acquireCookieTokenByUrlTokenGenerates cookie-token object based on valid URL-token value. Provided URL-token will be invalidated after that.- Parameters:
- urlTokenValue- token value extracted from url
- Returns:
- new cookie-token object.
 
- 
generateUrlTokenValue
- 
generateCookieTokenValue
 
-