# Class IdTokenVerifier.Builder (1.39.0)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [1.39.0 (latest)](https://docs.cloud.google.com/java/docs/reference/google-oauth-client/latest/com.google.api.client.auth.openidconnect.IdTokenVerifier.Builder)
- [1.38.2](https://docs.cloud.google.com/java/docs/reference/google-oauth-client/1.38.2/com.google.api.client.auth.openidconnect.IdTokenVerifier.Builder)
- [1.37.0](https://docs.cloud.google.com/java/docs/reference/google-oauth-client/1.37.0/com.google.api.client.auth.openidconnect.IdTokenVerifier.Builder)
- [1.36.0](https://docs.cloud.google.com/java/docs/reference/google-oauth-client/1.36.0/com.google.api.client.auth.openidconnect.IdTokenVerifier.Builder)
- [1.34.1](https://docs.cloud.google.com/java/docs/reference/google-oauth-client/1.34.1/com.google.api.client.auth.openidconnect.IdTokenVerifier.Builder)
- [1.33.3](https://docs.cloud.google.com/java/docs/reference/google-oauth-client/1.33.3/com.google.api.client.auth.openidconnect.IdTokenVerifier.Builder)
- [1.32.1](https://docs.cloud.google.com/java/docs/reference/google-oauth-client/1.32.1/com.google.api.client.auth.openidconnect.IdTokenVerifier.Builder)

    public static class IdTokenVerifier.Builder

Builder for [IdTokenVerifier](https://docs.cloud.google.com/java/docs/reference/google-oauth-client/latest/com.google.api.client.auth.openidconnect.IdTokenVerifier).

Implementation is not thread-safe.

## Inheritance

[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \> IdTokenVerifier.Builder

## Inherited Members

[Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) [Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) [Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) [Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) [Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) [Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) [Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) [Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) [Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) [Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) [Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)

## Constructors

### Builder()

    public Builder()

## Methods

### build()

    public IdTokenVerifier build()

Builds a new instance of [IdTokenVerifier](https://docs.cloud.google.com/java/docs/reference/google-oauth-client/latest/com.google.api.client.auth.openidconnect.IdTokenVerifier).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-oauth-client/latest/com.google.api.client.auth.openidconnect.IdTokenVerifier` |   |

### getAcceptableTimeSkewSeconds()

    public final long getAcceptableTimeSkewSeconds()

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### getAudience()

    public final Collection<String> getAudience()

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html>` |   |

### getClock()

    public final Clock getClock()

Returns the clock.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `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** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### getIssuers()

    public final Collection<String> getIssuers()

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html>` |   |

### 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** ||
|---|---|
| **Name** | **Description** |
| `acceptableTimeSkewSeconds` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-oauth-client/latest/com.google.api.client.auth.openidconnect.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** ||
|---|---|
| **Name** | **Description** |
| `audience` | `https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-oauth-client/latest/com.google.api.client.auth.openidconnect.IdTokenVerifier.Builder` |   |

### setCertificatesLocation(String certificatesLocation)

    public IdTokenVerifier.Builder setCertificatesLocation(String certificatesLocation)

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `certificatesLocation` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` URL to published public keys |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-oauth-client/latest/com.google.api.client.auth.openidconnect.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** ||
|---|---|
| **Name** | **Description** |
| `clock` | `com.google.api.client.util.Clock` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-oauth-client/latest/com.google.api.client.auth.openidconnect.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** ||
|---|---|
| **Name** | **Description** |
| `httpTransportFactory` | `https://docs.cloud.google.com/java/docs/reference/google-oauth-client/latest/com.google.api.client.auth.openidconnect.HttpTransportFactory` the HttpTransportFactory used to build certificate URL requests |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-oauth-client/latest/com.google.api.client.auth.openidconnect.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** ||
|---|---|
| **Name** | **Description** |
| `issuer` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-oauth-client/latest/com.google.api.client.auth.openidconnect.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** ||
|---|---|
| **Name** | **Description** |
| `issuers` | `https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-oauth-client/latest/com.google.api.client.auth.openidconnect.IdTokenVerifier.Builder` |   |