Class IdTokenVerifier.Builder
- java.lang.Object
-
- com.google.api.client.auth.openidconnect.IdTokenVerifier.Builder
-
- Enclosing class:
- IdTokenVerifier
@Beta public static class IdTokenVerifier.Builder extends Object
- Since:
- 1.16
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IdTokenVerifier
build()
Builds a new instance ofIdTokenVerifier
.long
getAcceptableTimeSkewSeconds()
Returns the seconds of time skew to accept when verifying time.Collection<String>
getAudience()
Returns the list of trusted audience client IDs ornull
to suppress the audience check.com.google.api.client.util.Clock
getClock()
Returns the clock.String
getIssuer()
Returns the first of equivalent expected issuers ornull
if issuer check suppressed.Collection<String>
getIssuers()
Returns the equivalent expected issuers ornull
if issuer check suppressed.IdTokenVerifier.Builder
setAcceptableTimeSkewSeconds(long acceptableTimeSkewSeconds)
Sets the seconds of time skew to accept when verifying time (default isIdTokenVerifier.DEFAULT_TIME_SKEW_SECONDS
).IdTokenVerifier.Builder
setAudience(Collection<String> audience)
Sets the list of trusted audience client IDs ornull
to suppress the audience check.IdTokenVerifier.Builder
setClock(com.google.api.client.util.Clock clock)
Sets the clock.IdTokenVerifier.Builder
setIssuer(String issuer)
Sets the expected issuer ornull
to suppress the issuer check.IdTokenVerifier.Builder
setIssuers(Collection<String> issuers)
Sets the list of equivalent expected issuers ornull
to suppress the issuer check.
-
-
-
Method Detail
-
build
public IdTokenVerifier build()
Builds a new instance ofIdTokenVerifier
.
-
getClock
public final com.google.api.client.util.Clock getClock()
Returns the clock.
-
setClock
public IdTokenVerifier.Builder setClock(com.google.api.client.util.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.
-
getIssuer
public final String getIssuer()
Returns the first of equivalent expected issuers ornull
if issuer check suppressed.
-
setIssuer
public IdTokenVerifier.Builder setIssuer(String issuer)
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.
-
getIssuers
public final Collection<String> getIssuers()
Returns the equivalent expected issuers ornull
if issuer check suppressed.- Since:
- 1.21.0
-
setIssuers
public IdTokenVerifier.Builder setIssuers(Collection<String> issuers)
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
public final Collection<String> getAudience()
Returns the list of trusted audience client IDs ornull
to suppress the audience check.
-
setAudience
public IdTokenVerifier.Builder setAudience(Collection<String> audience)
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
public IdTokenVerifier.Builder setAcceptableTimeSkewSeconds(long acceptableTimeSkewSeconds)
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.
-
-