Class IdTokenVerifier.Builder (1.33.3)

public static class IdTokenVerifier.Builder

Beta
Builder for IdTokenVerifier.

Implementation is not thread-safe.

Inheritance

java.lang.Object > IdTokenVerifier.Builder

Constructors

Builder()

public Builder()

Methods

build()

public IdTokenVerifier build()

Builds a new instance of IdTokenVerifier.

Returns
TypeDescription
IdTokenVerifier

getAcceptableTimeSkewSeconds()

public final long getAcceptableTimeSkewSeconds()

Returns the seconds of time skew to accept when verifying time.

Returns
TypeDescription
long

getAudience()

public final Collection<String> getAudience()

Returns the list of trusted audience client IDs or null to suppress the audience check.

Returns
TypeDescription
Collection<String>

getClock()

public final Clock getClock()

Returns the clock.

Returns
TypeDescription
com.google.api.client.util.Clock

getIssuer()

public final String getIssuer()

Returns the first of equivalent expected issuers or null if issuer check suppressed.

Returns
TypeDescription
String

getIssuers()

public final Collection<String> getIssuers()

Returns the equivalent expected issuers or null if issuer check suppressed.

Returns
TypeDescription
Collection<String>

setAcceptableTimeSkewSeconds(long acceptableTimeSkewSeconds)

public IdTokenVerifier.Builder setAcceptableTimeSkewSeconds(long acceptableTimeSkewSeconds)

Sets the seconds of time skew to accept when verifying time (default is #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.

Parameter
NameDescription
acceptableTimeSkewSecondslong
Returns
TypeDescription
IdTokenVerifier.Builder

setAudience(Collection<String> audience)

public IdTokenVerifier.Builder setAudience(Collection<String> audience)

Sets the list of trusted audience client IDs or null 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.

Parameter
NameDescription
audienceCollection<String>
Returns
TypeDescription
IdTokenVerifier.Builder

setCertificatesLocation(String certificatesLocation)

public IdTokenVerifier.Builder setCertificatesLocation(String certificatesLocation)

Override the location URL that contains published public keys. Defaults to well-known Google locations.

Parameter
NameDescription
certificatesLocationString

URL to published public keys

Returns
TypeDescription
IdTokenVerifier.Builder

the builder

setClock(Clock clock)

public IdTokenVerifier.Builder setClock(Clock clock)

Sets the clock.

Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.

Parameter
NameDescription
clockcom.google.api.client.util.Clock
Returns
TypeDescription
IdTokenVerifier.Builder

setHttpTransportFactory(HttpTransportFactory httpTransportFactory)

public IdTokenVerifier.Builder setHttpTransportFactory(HttpTransportFactory httpTransportFactory)

Sets the HttpTransportFactory used for requesting public keys from the certificate URL. Used mostly for testing.

Parameter
NameDescription
httpTransportFactoryHttpTransportFactory

the HttpTransportFactory used to build certificate URL requests

Returns
TypeDescription
IdTokenVerifier.Builder

the builder

setIssuer(String issuer)

public IdTokenVerifier.Builder setIssuer(String issuer)

Sets the expected issuer or null 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.

Parameter
NameDescription
issuerString
Returns
TypeDescription
IdTokenVerifier.Builder

setIssuers(Collection<String> issuers)

public IdTokenVerifier.Builder setIssuers(Collection<String> issuers)

Sets the list of equivalent expected issuers or null 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.

Parameter
NameDescription
issuersCollection<String>
Returns
TypeDescription
IdTokenVerifier.Builder