Package com.okta.jwt.impl.jjwt
Class JjwtAccessTokenVerifierBuilder
java.lang.Object
com.okta.jwt.impl.jjwt.JjwtAccessTokenVerifierBuilder
- All Implemented Interfaces:
AccessTokenVerifier.Builder
,VerifierBuilderSupport<AccessTokenVerifier.Builder,
AccessTokenVerifier>
public final class JjwtAccessTokenVerifierBuilder
extends Object
implements AccessTokenVerifier.Builder
Classes in this `impl` implementation package may change in NON backward compatible way, and should ONLY be used as
a "runtime" dependency.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Constructs a JWT Verifier.boolean
getClock()
boolean
int
int
int
hashCode()
protected HttpClient
protected String
resolveKeysEndpoint
(String issuer) protected AccessTokenVerifier.Builder
self()
setAudience
(String audience) Sets the audience the verifier will expect.Sets theclock
the verifier will use for evaluating token expiration.setConnectionTimeout
(Duration connectionTimeout) Sets theconnectionTimeout
for the verifier.Sets theissuer
the verifier will expect.Sets theleeway
the verifier will allow.setPreloadSigningKeys
(boolean preloadSigningKeys) Sets thepreloadSigningKeys
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 theretryMaxAttempts
the verifier will allow when making HTTP requests to the "keys" endpoint.setRetryMaxElapsed
(Duration retryMaxElapsed) Sets theretryMaxElapsed
the verifier will allow when making HTTP requests to the "keys" endpoint.protected io.jsonwebtoken.SigningKeyResolver
protected void
validate()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.okta.jwt.VerifierBuilderSupport
setClock, setConnectionTimeout, setIssuer, setLeeway, setPreloadSigningKeys, setProxyHost, setProxyPassword, setProxyPort, setProxyUsername, setRetryMaxAttempts, setRetryMaxElapsed
-
Constructor Details
-
JjwtAccessTokenVerifierBuilder
public JjwtAccessTokenVerifierBuilder()
-
-
Method Details
-
setAudience
Description copied from interface:AccessTokenVerifier.Builder
Sets the audience the verifier will expect. Default implementation, uses "api://default" as the default value.- Specified by:
setAudience
in interfaceAccessTokenVerifier.Builder
- Parameters:
audience
- Audience- Returns:
- a reference to the current builder for use in method chaining
-
validate
protected void validate() -
build
Description copied from interface:VerifierBuilderSupport
Constructs a JWT Verifier.- Specified by:
build
in interfaceVerifierBuilderSupport<AccessTokenVerifier.Builder,
AccessTokenVerifier> - Returns:
- A JWT Verifier
-
setIssuer
Description copied from interface:VerifierBuilderSupport
Sets theissuer
the verifier will expect.- Specified by:
setIssuer
in interfaceVerifierBuilderSupport<B extends VerifierBuilderSupport,
R> - Parameters:
issuer
- Issuer URL- Returns:
- a reference to the current builder for use in method chaining
-
setLeeway
Description copied from interface:VerifierBuilderSupport
Sets theleeway
the verifier will allow.- Specified by:
setLeeway
in interfaceVerifierBuilderSupport<B extends VerifierBuilderSupport,
R> - Parameters:
leeway
- clock skew leeway- Returns:
- a reference to the current builder for use in method chaining
-
setConnectionTimeout
Description copied from interface:VerifierBuilderSupport
Sets theconnectionTimeout
for the verifier.- Specified by:
setConnectionTimeout
in interfaceVerifierBuilderSupport<B extends VerifierBuilderSupport,
R> - Parameters:
connectionTimeout
- connection timeout- Returns:
- a reference to the current builder for use in method chaining
-
getProxyHost
-
setProxyHost
Description copied from interface:VerifierBuilderSupport
Sets the proxy host used for the configured HTTP proxy.- Specified by:
setProxyHost
in interfaceVerifierBuilderSupport<B extends VerifierBuilderSupport,
R> - Parameters:
proxyHost
- the proxy host used for the configured HTTP proxy- Returns:
- a reference to the current builder for use in method chaining
-
getProxyPort
public int getProxyPort() -
setProxyPort
Description copied from interface:VerifierBuilderSupport
Sets the proxy port used for the configured HTTP proxy.- Specified by:
setProxyPort
in interfaceVerifierBuilderSupport<B extends VerifierBuilderSupport,
R> - Parameters:
proxyPort
- the proxy port used for the configured HTTP proxy- Returns:
- a reference to the current builder for use in method chaining
-
getProxyUsername
-
setProxyUsername
Description copied from interface:VerifierBuilderSupport
Sets the proxy username used for the configured HTTP proxy.- Specified by:
setProxyUsername
in interfaceVerifierBuilderSupport<B extends VerifierBuilderSupport,
R> - Parameters:
proxyUsername
- the proxy username used for the configured HTTP proxy- Returns:
- a reference to the current builder for use in method chaining
-
getProxyPassword
-
setProxyPassword
Description copied from interface:VerifierBuilderSupport
Sets the proxy password used for the configured HTTP proxy.- Specified by:
setProxyPassword
in interfaceVerifierBuilderSupport<B extends VerifierBuilderSupport,
R> - Parameters:
proxyPassword
- the proxy password used for the configured HTTP proxy- Returns:
- a reference to the current builder for use in method chaining
-
getRetryMaxAttempts
public int getRetryMaxAttempts() -
setRetryMaxAttempts
Description copied from interface:VerifierBuilderSupport
Sets theretryMaxAttempts
the verifier will allow when making HTTP requests to the "keys" endpoint.- Specified by:
setRetryMaxAttempts
in interfaceVerifierBuilderSupport<B extends VerifierBuilderSupport,
R> - Parameters:
retryMaxAttempts
- The maximum number of times to retry HTTP requests- Returns:
- a reference to the current builder for use in method chaining
-
getMaxHttpRetryElapsed
-
setRetryMaxElapsed
Description copied from interface:VerifierBuilderSupport
Sets theretryMaxElapsed
the verifier will allow when making HTTP requests to the "keys" endpoint.- Specified by:
setRetryMaxElapsed
in interfaceVerifierBuilderSupport<B extends VerifierBuilderSupport,
R> - Parameters:
retryMaxElapsed
- the max duration for the total of HTTP request- Returns:
- a reference to the current builder for use in method chaining
-
getClock
-
setClock
Description copied from interface:VerifierBuilderSupport
Sets theclock
the verifier will use for evaluating token expiration.- Specified by:
setClock
in interfaceVerifierBuilderSupport<B extends VerifierBuilderSupport,
R> - 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
-
getPreloadSigningKeys
public boolean getPreloadSigningKeys() -
setPreloadSigningKeys
Description copied from interface:VerifierBuilderSupport
Sets thepreloadSigningKeys
the verifier will use to determine if it needs to prefetch Signing keys into cache at boot time.- Specified by:
setPreloadSigningKeys
in interfaceVerifierBuilderSupport<B extends VerifierBuilderSupport,
R> - 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
-
self
-
resolveKeysEndpoint
-
signingKeyResolver
protected io.jsonwebtoken.SigningKeyResolver signingKeyResolver() -
httpClient
-
equals
-
hashCode
public int hashCode()
-