# OAuthCredential


```
public abstract class OAuthCredential extends AuthCredential
```

<br />

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) |||
| ↳ | [com.google.firebase.auth.AuthCredential](https://firebase.google.com/docs/reference/android/com/google/firebase/auth/AuthCredential) ||
|   | ↳ | [com.google.firebase.auth.OAuthCredential](https://firebase.google.com/docs/reference/android/com/google/firebase/auth/OAuthCredential) |

*** ** * ** ***

Holds credentials generated by a sign-in with a credential to an IDP that uses OAuth

## Summary

| ### Public constructors |
|---|
| `https://firebase.google.com/docs/reference/android/com/google/firebase/auth/OAuthCredential#OAuthCredential()()` |

| ### Public methods |
|---|---|
| `abstract @https://developer.android.com/reference/androidx/annotation/Nullable.html https://developer.android.com/reference/java/lang/String.html` | `https://firebase.google.com/docs/reference/android/com/google/firebase/auth/OAuthCredential#getAccessToken()()` Returns the OAuth access token associated with this credential. |
| `abstract @https://developer.android.com/reference/androidx/annotation/Nullable.html https://developer.android.com/reference/java/lang/String.html` | `https://firebase.google.com/docs/reference/android/com/google/firebase/auth/OAuthCredential#getIdToken()()` Returns the OAuth ID token associated with this credential. |
| `abstract @https://developer.android.com/reference/androidx/annotation/Nullable.html https://developer.android.com/reference/java/lang/String.html` | `https://firebase.google.com/docs/reference/android/com/google/firebase/auth/OAuthCredential#getSecret()()` Returns the OAuth secret associated with this credential. |

### Inherited Constants

From [android.os.Parcelable](https://developer.android.com/reference/android/os/Parcelable.html) `static final int` `https://developer.android.com/reference/android/os/Parcelable.html#CONTENTS_FILE_DESCRIPTOR = 1` `static final int` `https://developer.android.com/reference/android/os/Parcelable.html#PARCELABLE_WRITE_RETURN_VALUE = 1`

### Inherited methods

From [com.google.firebase.auth.AuthCredential](https://firebase.google.com/docs/reference/android/com/google/firebase/auth/AuthCredential) `abstract @https://developer.android.com/reference/androidx/annotation/NonNull.html https://developer.android.com/reference/java/lang/String.html` `https://firebase.google.com/docs/reference/android/com/google/firebase/auth/AuthCredential#getProvider()()`

Returns the unique string identifier for the provider type with which the credential is associated.
`abstract @https://developer.android.com/reference/androidx/annotation/NonNull.html https://developer.android.com/reference/java/lang/String.html` `https://firebase.google.com/docs/reference/android/com/google/firebase/auth/AuthCredential#getSignInMethod()()`

Returns the unique string identifier for the sign in method with which the credential is associated.
From [android.os.Parcelable](https://developer.android.com/reference/android/os/Parcelable.html) `abstract int` `https://developer.android.com/reference/android/os/Parcelable.html#describeContents()()` `abstract void` `https://developer.android.com/reference/android/os/Parcelable.html#writeToParcel(android.os.Parcel, int)(https://developer.android.com/reference/android/os/Parcel.html p, int p1)`

## Public constructors

### OAuthCredential

```
public OAuthCredential()
```

## Public methods

### getAccessToken

```
public abstract @Nullable String getAccessToken()
```

Returns the OAuth access token associated with this credential.

### getIdToken

```
public abstract @Nullable String getIdToken()
```

Returns the OAuth ID token associated with this credential.

### getSecret

```
public abstract @Nullable String getSecret()
```

Returns the OAuth secret associated with this credential. This will be null for OAuth 2.0 providers.