Project: /docs/reference/js/_project.yaml Book: /docs/reference/_book.yaml page_type: reference
{% comment %} DO NOT EDIT THIS FILE! This is generated by the JS SDK team, and any local changes will be overwritten. Changes should be made in the source code at https://github.com/firebase/firebase-js-sdk {% endcomment %}
Represents the OAuth credentials returned by an OAuthProvider.
Implementations specify the details about each auth provider's credential requirements.
Signature:
export declare class OAuthCredential extends AuthCredential Extends: AuthCredential
| Property | Modifiers | Type | Description |
|---|---|---|---|
| accessToken | string | The OAuth access token associated with the credential if it belongs to an OAuthProvider, such as facebook.com, twitter.com, etc. |
|
| idToken | string | The OAuth ID token associated with the credential if it belongs to an OIDC provider, such as google.com. |
|
| secret | string | The OAuth access token secret associated with the credential if it belongs to an OAuth 1.0 provider, such as twitter.com. |
| Method | Modifiers | Description |
|---|---|---|
| fromJSON(json) | static |
Static method to deserialize a JSON representation of an object into an AuthCredential. |
| toJSON() | Returns a JSON-serializable representation of this object. |
The OAuth access token associated with the credential if it belongs to an OAuthProvider, such as facebook.com, twitter.com, etc.
Signature:
accessToken?: string;The OAuth ID token associated with the credential if it belongs to an OIDC provider, such as google.com.
Signature:
idToken?: string;The OAuth access token secret associated with the credential if it belongs to an OAuth 1.0 provider, such as twitter.com.
Signature:
secret?: string;Static method to deserialize a JSON representation of an object into an AuthCredential.
Signature:
static fromJSON(json: string | object): OAuthCredential | null;| Parameter | Type | Description |
|---|---|---|
| json | string | object | Input can be either Object or the stringified representation of the object. When string is provided, JSON.parse would be called first. |
Returns:
OAuthCredential | null
If the JSON input does not represent an AuthCredential, null is returned.
Returns a JSON-serializable representation of this object.
Signature:
toJSON(): object;Returns:
object
a JSON-serializable representation of this object.