2.9.3 (latest) 2.9.2 2.8.1 2.7.2 2.6.0 2.5.1 2.4.1 2.1.2 2.0.1 1.35.2 1.34.1 1.33.4

```java
public static class AppIdentityCredential.AppEngineCredentialWrapper extends GoogleCredential
```
Beta   

Credential wrapper for application identity that inherits from GoogleCredential.

## Inheritance

[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \> com.google.api.client.auth.oauth2.Credential \> [GoogleCredential](https://docs.cloud.google.com/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.auth.oauth2.GoogleCredential.md.txt) \> AppIdentityCredential.AppEngineCredentialWrapper

## Inherited Members

com.google.api.client.auth.oauth2.Credential.getAccessToken() com.google.api.client.auth.oauth2.Credential.getClientAuthentication() com.google.api.client.auth.oauth2.Credential.getClock() com.google.api.client.auth.oauth2.Credential.getExpirationTimeMilliseconds() com.google.api.client.auth.oauth2.Credential.getExpiresInSeconds() com.google.api.client.auth.oauth2.Credential.getJsonFactory() com.google.api.client.auth.oauth2.Credential.getMethod() com.google.api.client.auth.oauth2.Credential.getRefreshListeners() com.google.api.client.auth.oauth2.Credential.getRefreshToken() com.google.api.client.auth.oauth2.Credential.getRequestInitializer() com.google.api.client.auth.oauth2.Credential.getTokenServerEncodedUrl() com.google.api.client.auth.oauth2.Credential.getTransport() com.google.api.client.auth.oauth2.Credential.handleResponse(com.google.api.client.http.HttpRequest,com.google.api.client.http.HttpResponse,boolean) com.google.api.client.auth.oauth2.Credential.initialize(com.google.api.client.http.HttpRequest) com.google.api.client.auth.oauth2.Credential.intercept(com.google.api.client.http.HttpRequest) com.google.api.client.auth.oauth2.Credential.refreshToken() [GoogleCredential.createDelegated(String)](https://docs.cloud.google.com/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.auth.oauth2.GoogleCredential.md.txt#com_google_api_client_googleapis_auth_oauth2_GoogleCredential_createDelegated_java_lang_String_) [GoogleCredential.createScoped(Collection\<String\>)](https://docs.cloud.google.com/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.auth.oauth2.GoogleCredential.md.txt#com_google_api_client_googleapis_auth_oauth2_GoogleCredential_createScoped_java_util_Collection_java_lang_String__) [GoogleCredential.createScopedRequired()](https://docs.cloud.google.com/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.auth.oauth2.GoogleCredential.md.txt#com_google_api_client_googleapis_auth_oauth2_GoogleCredential_createScopedRequired__) [GoogleCredential.executeRefreshToken()](https://docs.cloud.google.com/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.auth.oauth2.GoogleCredential.md.txt#com_google_api_client_googleapis_auth_oauth2_GoogleCredential_executeRefreshToken__) [GoogleCredential.fromStream(InputStream)](https://docs.cloud.google.com/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.auth.oauth2.GoogleCredential.md.txt#com_google_api_client_googleapis_auth_oauth2_GoogleCredential_fromStream_java_io_InputStream_) [GoogleCredential.fromStream(InputStream,HttpTransport,JsonFactory)](https://docs.cloud.google.com/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.auth.oauth2.GoogleCredential.md.txt#com_google_api_client_googleapis_auth_oauth2_GoogleCredential_fromStream_java_io_InputStream_com_google_api_client_http_HttpTransport_com_google_api_client_json_JsonFactory_) [GoogleCredential.getApplicationDefault()](https://docs.cloud.google.com/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.auth.oauth2.GoogleCredential.md.txt#com_google_api_client_googleapis_auth_oauth2_GoogleCredential_getApplicationDefault__) [GoogleCredential.getApplicationDefault(HttpTransport,JsonFactory)](https://docs.cloud.google.com/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.auth.oauth2.GoogleCredential.md.txt#com_google_api_client_googleapis_auth_oauth2_GoogleCredential_getApplicationDefault_com_google_api_client_http_HttpTransport_com_google_api_client_json_JsonFactory_) [GoogleCredential.getServiceAccountId()](https://docs.cloud.google.com/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.auth.oauth2.GoogleCredential.md.txt#com_google_api_client_googleapis_auth_oauth2_GoogleCredential_getServiceAccountId__) [GoogleCredential.getServiceAccountPrivateKey()](https://docs.cloud.google.com/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.auth.oauth2.GoogleCredential.md.txt#com_google_api_client_googleapis_auth_oauth2_GoogleCredential_getServiceAccountPrivateKey__) [GoogleCredential.getServiceAccountPrivateKeyId()](https://docs.cloud.google.com/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.auth.oauth2.GoogleCredential.md.txt#com_google_api_client_googleapis_auth_oauth2_GoogleCredential_getServiceAccountPrivateKeyId__) [GoogleCredential.getServiceAccountProjectId()](https://docs.cloud.google.com/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.auth.oauth2.GoogleCredential.md.txt#com_google_api_client_googleapis_auth_oauth2_GoogleCredential_getServiceAccountProjectId__) [GoogleCredential.getServiceAccountScopes()](https://docs.cloud.google.com/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.auth.oauth2.GoogleCredential.md.txt#com_google_api_client_googleapis_auth_oauth2_GoogleCredential_getServiceAccountScopes__) [GoogleCredential.getServiceAccountScopesAsString()](https://docs.cloud.google.com/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.auth.oauth2.GoogleCredential.md.txt#com_google_api_client_googleapis_auth_oauth2_GoogleCredential_getServiceAccountScopesAsString__) [GoogleCredential.getServiceAccountUser()](https://docs.cloud.google.com/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.auth.oauth2.GoogleCredential.md.txt#com_google_api_client_googleapis_auth_oauth2_GoogleCredential_getServiceAccountUser__) [GoogleCredential.setAccessToken(String)](https://docs.cloud.google.com/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.auth.oauth2.GoogleCredential.md.txt#com_google_api_client_googleapis_auth_oauth2_GoogleCredential_setAccessToken_java_lang_String_) [GoogleCredential.setExpirationTimeMilliseconds(Long)](https://docs.cloud.google.com/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.auth.oauth2.GoogleCredential.md.txt#com_google_api_client_googleapis_auth_oauth2_GoogleCredential_setExpirationTimeMilliseconds_java_lang_Long_) [GoogleCredential.setExpiresInSeconds(Long)](https://docs.cloud.google.com/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.auth.oauth2.GoogleCredential.md.txt#com_google_api_client_googleapis_auth_oauth2_GoogleCredential_setExpiresInSeconds_java_lang_Long_) [GoogleCredential.setFromTokenResponse(TokenResponse)](https://docs.cloud.google.com/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.auth.oauth2.GoogleCredential.md.txt#com_google_api_client_googleapis_auth_oauth2_GoogleCredential_setFromTokenResponse_com_google_api_client_auth_oauth2_TokenResponse_) [GoogleCredential.setRefreshToken(String)](https://docs.cloud.google.com/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.auth.oauth2.GoogleCredential.md.txt#com_google_api_client_googleapis_auth_oauth2_GoogleCredential_setRefreshToken_java_lang_String_) [GoogleCredential.toBuilder()](https://docs.cloud.google.com/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.auth.oauth2.GoogleCredential.md.txt#com_google_api_client_googleapis_auth_oauth2_GoogleCredential_toBuilder__) [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

### AppEngineCredentialWrapper(HttpTransport transport, JsonFactory jsonFactory)

```java
public AppEngineCredentialWrapper(HttpTransport transport, JsonFactory jsonFactory)
```
Constructs the wrapper using the default AppIdentityService.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `transport` | `com.google.api.client.http.HttpTransport` the transport for Http calls. |
| `jsonFactory` | `com.google.api.client.json.JsonFactory` the factory for Json parsing and formatting. |

## Methods

### createScoped(Collection\<String\> scopes)

```java
public GoogleCredential createScoped(Collection<String> scopes)
```
Beta   

For credentials that require scopes, creates a copy of the credential with the specified
scopes.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `scopes` | `Collection<String>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `GoogleCredential` |   |

**Overrides** [GoogleCredential.createScoped(Collection\<String\> scopes)](https://docs.cloud.google.com/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.auth.oauth2.GoogleCredential.md.txt#com_google_api_client_googleapis_auth_oauth2_GoogleCredential_createScoped_java_util_Collection_java_lang_String__)

### createScopedRequired()

```java
public boolean createScopedRequired()
```
Beta   

Indicates whether the credential requires scopes to be specified by calling createScoped before
use.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `boolean` |   |

**Overrides** [GoogleCredential.createScopedRequired()](https://docs.cloud.google.com/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.auth.oauth2.GoogleCredential.md.txt#com_google_api_client_googleapis_auth_oauth2_GoogleCredential_createScopedRequired__)

### executeRefreshToken()

```java
protected TokenResponse executeRefreshToken()
```

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.api.client.auth.oauth2.TokenResponse` |   |

**Overrides** [GoogleCredential.executeRefreshToken()](https://docs.cloud.google.com/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.auth.oauth2.GoogleCredential.md.txt#com_google_api_client_googleapis_auth_oauth2_GoogleCredential_executeRefreshToken__)

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `IOException` |   |

### intercept(HttpRequest request)

```java
public void intercept(HttpRequest request)
```

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `com.google.api.client.http.HttpRequest` |

**Overrides** com.google.api.client.auth.oauth2.Credential.intercept(com.google.api.client.http.HttpRequest)

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `IOException` |   |