Class JsonGenerateOneTimeTokenRequestResolver

java.lang.Object
org.jwcarman.who.emaillink.JsonGenerateOneTimeTokenRequestResolver
All Implemented Interfaces:
org.springframework.security.web.authentication.ott.GenerateOneTimeTokenRequestResolver

public class JsonGenerateOneTimeTokenRequestResolver extends Object implements org.springframework.security.web.authentication.ott.GenerateOneTimeTokenRequestResolver
Reads {"email": "..."} from the body of POST /who/email/send.

Malformed input of any kind never throws and never yields null (which would make Spring skip the success handler and answer differently): it yields a request for NO_ADDRESS, which EmailLinkIssuer ignores, so the caller still gets 202.

  • Field Details

    • NO_ADDRESS

      public static final String NO_ADDRESS
      The username used for malformed requests. Spring rejects a blank username, so this stands in for "no address"; it contains no @, so it can never be a registered address.
      See Also:
  • Constructor Details

    • JsonGenerateOneTimeTokenRequestResolver

      public JsonGenerateOneTimeTokenRequestResolver(tools.jackson.databind.json.JsonMapper jsonMapper)
      Creates a new resolver.
      Parameters:
      jsonMapper - the JSON mapper
  • Method Details

    • resolve

      public org.springframework.security.authentication.ott.GenerateOneTimeTokenRequest resolve(jakarta.servlet.http.HttpServletRequest request)
      Specified by:
      resolve in interface org.springframework.security.web.authentication.ott.GenerateOneTimeTokenRequestResolver