Class IdTokenVerifier.Builder
java.lang.Object
com.google.api.client.auth.openidconnect.IdTokenVerifier.Builder
- Enclosing class:
IdTokenVerifier
- Since:
- 1.16
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) long
Seconds of time skew to accept when verifying time.(package private) Collection
<String> List of trusted audience client IDs ornull
to suppress the audience check.(package private) String
(package private) com.google.api.client.util.Clock
Clock.(package private) Environment
wrapper for environment variables(package private) HttpTransportFactory
(package private) Collection
<String> Collection of equivalent expected issuers ornull
to suppress the issuer check. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds a new instance ofIdTokenVerifier
.final long
Returns the seconds of time skew to accept when verifying time.final Collection
<String> Returns the list of trusted audience client IDs ornull
to suppress the audience check.final com.google.api.client.util.Clock
getClock()
Returns the clock.(package private) final Environment
Returns an instance of theEnvironment
final String
Returns the first of equivalent expected issuers ornull
if issuer check suppressed.final Collection
<String> Returns the equivalent expected issuers ornull
if issuer check suppressed.setAcceptableTimeSkewSeconds
(long acceptableTimeSkewSeconds) Sets the seconds of time skew to accept when verifying time (default isIdTokenVerifier.DEFAULT_TIME_SKEW_SECONDS
).setAudience
(Collection<String> audience) Sets the list of trusted audience client IDs ornull
to suppress the audience check.setCertificatesLocation
(String certificatesLocation) Override the location URL that contains published public keys.setClock
(com.google.api.client.util.Clock clock) Sets the clock.(package private) IdTokenVerifier.Builder
setEnvironment
(Environment environment) Sets the environment.setHttpTransportFactory
(HttpTransportFactory httpTransportFactory) Sets the HttpTransportFactory used for requesting public keys from the certificate URL.Sets the expected issuer ornull
to suppress the issuer check.setIssuers
(Collection<String> issuers) Sets the list of equivalent expected issuers ornull
to suppress the issuer check.
-
Field Details
-
clock
com.google.api.client.util.Clock clockClock. -
certificatesLocation
String certificatesLocation -
environment
Environment environmentwrapper for environment variables -
acceptableTimeSkewSeconds
long acceptableTimeSkewSecondsSeconds of time skew to accept when verifying time. -
issuers
Collection<String> issuersCollection of equivalent expected issuers ornull
to suppress the issuer check. -
audience
Collection<String> audienceList of trusted audience client IDs ornull
to suppress the audience check. -
httpTransportFactory
HttpTransportFactory httpTransportFactory
-
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
build
Builds a new instance ofIdTokenVerifier
. -
getClock
public final com.google.api.client.util.Clock getClock()Returns the clock. -
setClock
Sets the clock.Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
-
getIssuer
Returns the first of equivalent expected issuers ornull
if issuer check suppressed. -
setIssuer
Sets the expected issuer ornull
to suppress the issuer check.Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
-
setCertificatesLocation
Override the location URL that contains published public keys. Defaults to well-known Google locations.- Parameters:
certificatesLocation
- URL to published public keys- Returns:
- the builder
-
getIssuers
Returns the equivalent expected issuers ornull
if issuer check suppressed.- Since:
- 1.21.0
-
setIssuers
Sets the list of equivalent expected issuers ornull
to suppress the issuer check. Typically only a single issuer should be used, but multiple may be specified to support an issuer transitioning to a new string. The collection must not be empty.Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
- Since:
- 1.21.0
-
getAudience
Returns the list of trusted audience client IDs ornull
to suppress the audience check. -
setAudience
Sets the list of trusted audience client IDs ornull
to suppress the audience check.Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
-
getAcceptableTimeSkewSeconds
public final long getAcceptableTimeSkewSeconds()Returns the seconds of time skew to accept when verifying time. -
setAcceptableTimeSkewSeconds
Sets the seconds of time skew to accept when verifying time (default isIdTokenVerifier.DEFAULT_TIME_SKEW_SECONDS
).It must be greater or equal to zero.
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
-
getEnvironment
Returns an instance of theEnvironment
-
setEnvironment
Sets the environment. Used mostly for testing -
setHttpTransportFactory
Sets the HttpTransportFactory used for requesting public keys from the certificate URL. Used mostly for testing.- Parameters:
httpTransportFactory
- the HttpTransportFactory used to build certificate URL requests- Returns:
- the builder
-