Class WhoOneTimeTokenService
java.lang.Object
org.jwcarman.who.emaillink.WhoOneTimeTokenService
- All Implemented Interfaces:
org.springframework.security.authentication.ott.OneTimeTokenService
public class WhoOneTimeTokenService
extends Object
implements org.springframework.security.authentication.ott.OneTimeTokenService
Spring Security
OneTimeTokenService for email links.
generate(GenerateOneTimeTokenRequest) only creates a random value and touches no table, so it takes the same time
whether or not the address is known; EmailLinkIssuer stores the token later, on another
thread. consume(OneTimeTokenAuthenticationToken) is never used: EmailLinkAuthenticationProvider redeems sign-ins
itself, by link token or by code.
-
Constructor Summary
ConstructorsConstructorDescriptionWhoOneTimeTokenService(Clock clock, Duration tokenTtl) Creates a new service. -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.security.authentication.ott.OneTimeTokenconsume(org.springframework.security.authentication.ott.OneTimeTokenAuthenticationToken authenticationToken) Not supported;EmailLinkAuthenticationProviderredeems sign-ins.org.springframework.security.authentication.ott.OneTimeTokengenerate(org.springframework.security.authentication.ott.GenerateOneTimeTokenRequest request) Generates a random token for the requested address without storing anything.
-
Constructor Details
-
WhoOneTimeTokenService
-
-
Method Details
-
generate
public org.springframework.security.authentication.ott.OneTimeToken generate(org.springframework.security.authentication.ott.GenerateOneTimeTokenRequest request) Generates a random token for the requested address without storing anything.- Specified by:
generatein interfaceorg.springframework.security.authentication.ott.OneTimeTokenService- Parameters:
request- the request; its username is the address- Returns:
- the token
-
consume
public org.springframework.security.authentication.ott.OneTimeToken consume(org.springframework.security.authentication.ott.OneTimeTokenAuthenticationToken authenticationToken) Not supported;EmailLinkAuthenticationProviderredeems sign-ins.- Specified by:
consumein interfaceorg.springframework.security.authentication.ott.OneTimeTokenService- Parameters:
authenticationToken- ignored- Returns:
- never
- Throws:
UnsupportedOperationException- always
-