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
    Modifier and Type
    Field
    Description
    private final OttPolicy
    The rules of one-time tokens, which set the lifetime of each kind.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springframework.security.authentication.ott.GenerateOneTimeTokenRequest
    resolve(jakarta.servlet.http.HttpServletRequest request)
    Resolves the request.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • ottPolicy

      private final OttPolicy 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:
      resolve in interface org.springframework.security.web.authentication.ott.GenerateOneTimeTokenRequestResolver
      Parameters:
      request - the request.
      Returns:
      the token to generate, or null when the request names no identifier.