Class TrustedDeviceCookieWriter

java.lang.Object
com.irurueta.authserver.authorization.api.web.mfa.TrustedDeviceCookieWriter

@Component public class TrustedDeviceCookieWriter extends Object
Writes the cookie that identifies a trusted device. The __Host- prefix makes the browser accept it only over HTTPS, with Path=/ and no Domain; it is HttpOnly so scripts cannot read it and SameSite=Lax so it is not sent on cross-site subrequests. Its value is the token signed by the server (token.signature). It lives as long as the device stays trusted.
  • Field Details

    • clock

      private final Clock clock
      Source of the current time.
  • Constructor Details

    • TrustedDeviceCookieWriter

      public TrustedDeviceCookieWriter()
  • Method Details

    • write

      public void write(jakarta.servlet.http.HttpServletResponse response, CreatedTrustedDevice created)
      Adds the cookie of a device that has just been trusted to a response.
      Parameters:
      response - the response.
      created - the trusted device and its signed cookie value.