# OAuthCredential


```
abstract class OAuthCredential : AuthCredential
```

<br />

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) |||
| ↳ | [com.google.firebase.auth.AuthCredential](https://firebase.google.com/docs/reference/kotlin/com/google/firebase/auth/AuthCredential) ||
|   | ↳ | [com.google.firebase.auth.OAuthCredential](https://firebase.google.com/docs/reference/kotlin/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/kotlin/com/google/firebase/auth/OAuthCredential#OAuthCredential()()` |

| ### Public functions |
|---|---|
| `abstract https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html?` | `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/auth/OAuthCredential#getAccessToken()()` Returns the OAuth access token associated with this credential. |
| `abstract https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html?` | `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/auth/OAuthCredential#getIdToken()()` Returns the OAuth ID token associated with this credential. |
| `abstract https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html?` | `https://firebase.google.com/docs/reference/kotlin/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) `const https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/os/Parcelable.html#CONTENTS_FILE_DESCRIPTOR = 1` `const https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/os/Parcelable.html#PARCELABLE_WRITE_RETURN_VALUE = 1`

### Inherited functions

From [com.google.firebase.auth.AuthCredential](https://firebase.google.com/docs/reference/kotlin/com/google/firebase/auth/AuthCredential) `abstract https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/auth/AuthCredential#getProvider()()`

Returns the unique string identifier for the provider type with which the credential is associated.
`abstract https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` `https://firebase.google.com/docs/reference/kotlin/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 https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/os/Parcelable.html#describeContents()()` `abstract https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/os/Parcelable.html#writeToParcel(android.os.Parcel, int)(p: https://developer.android.com/reference/android/os/Parcel.html!, p1: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`

## Public constructors

### OAuthCredential

```
OAuthCredential()
```

## Public functions

### getAccessToken

```
abstract fun getAccessToken(): String?
```

Returns the OAuth access token associated with this credential.

### getIdToken

```
abstract fun getIdToken(): String?
```

Returns the OAuth ID token associated with this credential.

### getSecret

```
abstract fun getSecret(): String?
```

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