Class SigningKeyRetention

java.lang.Object
com.irurueta.authserver.authorization.application.keys.SigningKeyRetention

@Service public class SigningKeyRetention extends Object
Decides how long a retired signing key stays published. A key must be published for as long as any token it signed can still be presented, so the effective retention is the longest of the configured retention and the longest signed-token lifetime plus the allowed clock skew. The signed tokens are the access and ID tokens of the registered clients (reported by the SignedTokenLifetimes port) and the e-mail verification tokens.
  • Field Details

    • signedTokenLifetimes

      private final SignedTokenLifetimes signedTokenLifetimes
      Port that reports the lifetimes of the tokens the clients obtain.
    • configuredRetention

      @Value("${authserver.keys.retention:PT2H}") private final Duration configuredRetention
      Minimum retention (authserver.keys.retention, default 2 hours).
    • clockSkew

      @Value("${authserver.keys.clock-skew:PT60S}") private final Duration clockSkew
      Clock skew tolerated by the token consumers (authserver.keys.clock-skew, default 60 seconds).
  • Constructor Details

    • SigningKeyRetention

      public SigningKeyRetention()
  • Method Details

    • effective

      public Duration effective()
      Computes the effective retention at this moment: registering a client with longer-lived tokens lengthens it.
      Returns:
      the longest of the configured retention and the longest signed-token lifetime plus the clock skew.