Package com.okta.jwt

Interface VerifierBuilderSupport<B extends VerifierBuilderSupport,R>

Type Parameters:
B - Builder used for method chaining
R - JWT Verifier
All Known Subinterfaces:
AccessTokenVerifier.Builder, IdTokenVerifier.Builder
All Known Implementing Classes:
JjwtAccessTokenVerifierBuilder, JjwtIdTokenVerifierBuilder

public interface VerifierBuilderSupport<B extends VerifierBuilderSupport,R>
JWT Verifier Builder support class (defines common properties used for general JWT validation).
Since:
0.4
  • Method Summary

    Modifier and Type
    Method
    Description
    Constructs a JWT Verifier.
    setClock(Clock clock)
    Sets the clock the verifier will use for evaluating token expiration.
    setConnectionTimeout(Duration connectionTimeout)
    Sets the connectionTimeout for the verifier.
    setIssuer(String issuer)
    Sets the issuer the verifier will expect.
    Sets the leeway the verifier will allow.
    setPreloadSigningKeys(boolean preloadSigningKeys)
    Sets the preloadSigningKeys the verifier will use to determine if it needs to prefetch Signing keys into cache at boot time.
    setProxyHost(String proxyHost)
    Sets the proxy host used for the configured HTTP proxy.
    setProxyPassword(String proxyPassword)
    Sets the proxy password used for the configured HTTP proxy.
    setProxyPort(int proxyPort)
    Sets the proxy port used for the configured HTTP proxy.
    setProxyUsername(String proxyUsername)
    Sets the proxy username used for the configured HTTP proxy.
    setRetryMaxAttempts(int retryMaxAttempts)
    Sets the retryMaxAttempts the verifier will allow when making HTTP requests to the "keys" endpoint.
    setRetryMaxElapsed(Duration retryMaxElapsed)
    Sets the retryMaxElapsed the verifier will allow when making HTTP requests to the "keys" endpoint.
  • Method Details

    • setIssuer

      B setIssuer(String issuer)
      Sets the issuer the verifier will expect.
      Parameters:
      issuer - Issuer URL
      Returns:
      a reference to the current builder for use in method chaining
    • setLeeway

      B setLeeway(Duration leeway)
      Sets the leeway the verifier will allow.
      Parameters:
      leeway - clock skew leeway
      Returns:
      a reference to the current builder for use in method chaining
    • setConnectionTimeout

      B setConnectionTimeout(Duration connectionTimeout)
      Sets the connectionTimeout for the verifier.
      Parameters:
      connectionTimeout - connection timeout
      Returns:
      a reference to the current builder for use in method chaining
    • setProxyHost

      B setProxyHost(String proxyHost)
      Sets the proxy host used for the configured HTTP proxy.
      Parameters:
      proxyHost - the proxy host used for the configured HTTP proxy
      Returns:
      a reference to the current builder for use in method chaining
    • setProxyPort

      B setProxyPort(int proxyPort)
      Sets the proxy port used for the configured HTTP proxy.
      Parameters:
      proxyPort - the proxy port used for the configured HTTP proxy
      Returns:
      a reference to the current builder for use in method chaining
    • setProxyUsername

      B setProxyUsername(String proxyUsername)
      Sets the proxy username used for the configured HTTP proxy.
      Parameters:
      proxyUsername - the proxy username used for the configured HTTP proxy
      Returns:
      a reference to the current builder for use in method chaining
    • setProxyPassword

      B setProxyPassword(String proxyPassword)
      Sets the proxy password used for the configured HTTP proxy.
      Parameters:
      proxyPassword - the proxy password used for the configured HTTP proxy
      Returns:
      a reference to the current builder for use in method chaining
    • setRetryMaxAttempts

      B setRetryMaxAttempts(int retryMaxAttempts)
      Sets the retryMaxAttempts the verifier will allow when making HTTP requests to the "keys" endpoint.
      Parameters:
      retryMaxAttempts - The maximum number of times to retry HTTP requests
      Returns:
      a reference to the current builder for use in method chaining
    • setRetryMaxElapsed

      B setRetryMaxElapsed(Duration retryMaxElapsed)
      Sets the retryMaxElapsed the verifier will allow when making HTTP requests to the "keys" endpoint.
      Parameters:
      retryMaxElapsed - the max duration for the total of HTTP request
      Returns:
      a reference to the current builder for use in method chaining
    • setClock

      B setClock(Clock clock)
      Sets the clock the verifier will use for evaluating token expiration.
      Parameters:
      clock - specify an alternate clock, such as fixed or offset to be used during testing
      Returns:
      a reference to the current builder for use in method chaining
    • setPreloadSigningKeys

      B setPreloadSigningKeys(boolean preloadSigningKeys)
      Sets the preloadSigningKeys the verifier will use to determine if it needs to prefetch Signing keys into cache at boot time.
      Parameters:
      preloadSigningKeys - specify if we want to prefetch the signing keys from issuer's url at boot time
      Returns:
      a reference to the current builder for use in method chaining
    • build

      R build()
      Constructs a JWT Verifier.
      Returns:
      A JWT Verifier