@Transactional public class TransactionalRememberMeService extends Object implements CrowdRememberMeService
| Constructor and Description |
|---|
TransactionalRememberMeService(CrowdRememberMeTokenDAO tokenDAO,
CrowdRememberMeConfiguration rememberMeConfiguration,
com.atlassian.security.random.SecureTokenGenerator tokenGenerator,
Clock clock,
org.springframework.transaction.PlatformTransactionManager transactionManager) |
| Modifier and Type | Method and Description |
|---|---|
Optional<org.springframework.security.core.Authentication> |
authenticate(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Attempts to authenticate a request using the remember-me cookie provided on the request.
|
com.atlassian.fugue.Pair<InternalCrowdRememberMeToken,InternalCrowdRememberMeToken> |
claimSingleUseToken(InternalCrowdRememberMeToken token) |
void |
clearAllExpiredTokens()
Clears all expired remember me tokens
|
void |
clearAllTokens()
Clears all remember me tokens for all the users
|
void |
clearAllTokensForDirectory(Long directoryId)
Clears all remember me tokens for the users belonging to the given directoryId
|
void |
clearAllTokensForSeries(String series)
Clears all remember me tokens for the user with given series
|
void |
clearAllTokensForUserInDirectory(String username,
Long directoryId)
Clears all remember me tokens for the user with given username, and directory id
|
void |
createCookie(org.springframework.security.core.Authentication authentication,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Generates a new remember-me token for the user and sets the corresponding cookie on the response.
|
protected InternalCrowdRememberMeToken |
extractToken(javax.servlet.http.Cookie cookie) |
CrowdSpecificRememberMeSettings |
getConfiguration()
Retrieves current configuration
|
protected String |
getRemoteAddress(javax.servlet.http.HttpServletRequest request) |
LocalDateTime |
now() |
void |
removeCookie(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Clears the remember-me cookie and removes all remember-me tokens for the corresponding series
|
void |
saveConfiguration(CrowdSpecificRememberMeSettings configuration)
Validates and stores passed configuration, if
CrowdSpecificRememberMeSettings.isEnabled() happens to be
false all existing tokens will be expired immediately |
public TransactionalRememberMeService(CrowdRememberMeTokenDAO tokenDAO, CrowdRememberMeConfiguration rememberMeConfiguration, com.atlassian.security.random.SecureTokenGenerator tokenGenerator, Clock clock, org.springframework.transaction.PlatformTransactionManager transactionManager)
@Nullable public Optional<org.springframework.security.core.Authentication> authenticate(@Nonnull javax.servlet.http.HttpServletRequest request, @Nonnull javax.servlet.http.HttpServletResponse response)
CrowdRememberMeServiceauthenticate in interface CrowdRememberMeServicerequest - the requestresponse - the responseOptional.empty() if authentication failed.public void createCookie(@Nonnull org.springframework.security.core.Authentication authentication, @Nonnull javax.servlet.http.HttpServletRequest request, @Nonnull javax.servlet.http.HttpServletResponse response)
CrowdRememberMeServicecreateCookie in interface CrowdRememberMeServiceauthentication - valid authentication containing the user contextrequest - the requestresponse - the responsepublic void removeCookie(@Nonnull javax.servlet.http.HttpServletRequest request, @Nonnull javax.servlet.http.HttpServletResponse response)
CrowdRememberMeServiceremoveCookie in interface CrowdRememberMeServicerequest - the requestresponse - the responsepublic void clearAllTokensForSeries(String series)
CrowdRememberMeServiceclearAllTokensForSeries in interface CrowdRememberMeServicepublic void clearAllTokensForUserInDirectory(String username, Long directoryId)
CrowdRememberMeServiceclearAllTokensForUserInDirectory in interface CrowdRememberMeServicepublic void clearAllTokens()
CrowdRememberMeServiceclearAllTokens in interface CrowdRememberMeServicepublic void clearAllExpiredTokens()
CrowdRememberMeServiceclearAllExpiredTokens in interface CrowdRememberMeServicepublic void clearAllTokensForDirectory(Long directoryId)
CrowdRememberMeServiceclearAllTokensForDirectory in interface CrowdRememberMeServicepublic void saveConfiguration(CrowdSpecificRememberMeSettings configuration)
CrowdRememberMeServiceCrowdSpecificRememberMeSettings.isEnabled() happens to be
false all existing tokens will be expired immediatelysaveConfiguration in interface CrowdRememberMeServiceconfiguration - new configurationpublic CrowdSpecificRememberMeSettings getConfiguration()
CrowdRememberMeServicegetConfiguration in interface CrowdRememberMeServiceprotected InternalCrowdRememberMeToken extractToken(javax.servlet.http.Cookie cookie)
public com.atlassian.fugue.Pair<InternalCrowdRememberMeToken,InternalCrowdRememberMeToken> claimSingleUseToken(InternalCrowdRememberMeToken token)
protected String getRemoteAddress(javax.servlet.http.HttpServletRequest request)
public LocalDateTime now()
Copyright © 2024 Atlassian. All rights reserved.