Class OttGenerateRequestResolver
java.lang.Object
com.irurueta.authserver.authorization.api.web.ott.OttGenerateRequestResolver
- All Implemented Interfaces:
org.springframework.security.web.authentication.ott.GenerateOneTimeTokenRequestResolver
public class OttGenerateRequestResolver
extends Object
implements org.springframework.security.web.authentication.ott.GenerateOneTimeTokenRequestResolver
Resolves the request of
POST /ott/generate to the token Spring's filter asks the token service for. The
identifier is the username field of a sign-in and, for a second factor, the name of the signed-in user (never
a field a client could point at somebody else), cleaned of control characters and cut to what the token store
holds. The lifetime of the token is the one OttPolicy sets for its kind. A request that names no identifier
is not resolved, so the chain goes on as it would for any other path. Whether the identifier belongs to an account
is not looked at here: a token is issued for any identifier, and what is delivered is decided afterwards, so the
answer never tells.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.security.authentication.ott.GenerateOneTimeTokenRequestresolve(jakarta.servlet.http.HttpServletRequest request) Resolves the request.
-
Field Details
-
ottPolicy
The rules of one-time tokens, which set the lifetime of each kind.
-
-
Constructor Details
-
OttGenerateRequestResolver
public OttGenerateRequestResolver()
-
-
Method Details
-
resolve
public org.springframework.security.authentication.ott.GenerateOneTimeTokenRequest resolve(jakarta.servlet.http.HttpServletRequest request) Resolves the request.- Specified by:
resolvein interfaceorg.springframework.security.web.authentication.ott.GenerateOneTimeTokenRequestResolver- Parameters:
request- the request.- Returns:
- the token to generate, or
nullwhen the request names no identifier.
-