ExternalAccount
The ExternalAccount object describes a User's external account.
Overview
The ExternalAccount
object is a model around an identification obtained by an external provider (e.g. an OAuth provider such as Google).
External account must be verified, so that we can make sure they can be assigned to their rightful owners. The ExternalAccount
object holds all necessary state around the verification process.
Attributes
Name | Type | Description |
---|---|---|
id | string | A unique identifier for this external account. |
identificationId | string | The identification with which this external account is associated. |
provider | string | The provider name e.g. |
providerUserId | string | The unique id of the user in the provider. |
emailAddress | string | The provided email address of the user. |
approvedScopes | string[] | The scopes that the user has granted access to. |
firstName | string | The provided first name of the user. |
lastName | string | The provided last name of the user. |
avatarUrl | string | The provided avatar URL of the user. |
username | string | null | The provided username of the user. |
label | string | null | A descriptive label to differentiate multiple external accounts of the same user for the same provider. |
verification | VerificationResource | An object holding information on the verification of this external account. |
Methods
reauthorize(params)
reauthorize(params: ReauthorizeExternalAccountParams) => Promise<ExternalAccountResource>
Invoke a re-authorization flow for an existing external account.
Parameters
Name | Type | Description |
---|---|---|
additionalScopes | string[] | Any additional scopes you would like your user to be prompted to approve. |
redirectUrl | string | The URL to redirect back to one the OAuth flow has completed successfully or unsuccessfully. |
Returns
Type | Description |
---|---|
Promise<void> | This method returns a |
destroy()
destroy() => Promise<void>
Delete this external account.
Parameters
This method accepts no parameters.
Returns
Type | Description |
---|---|
Promise<void> | This method returns a |
Interfaces
VerificationResource
Name | Type | Description |
---|---|---|
status | string | null | The verification status. Possible values are:
|
strategy | string | null | The verification strategy. For example |
attempts | number | null | The number of attempts to complete the verification so far. Usually, a verification allows for maximum 3 attempts to be completed. |
expireAt | Date | null | The timestamp when the verification will expire and cease to be valid. |
error | ClerkAPIError | null | Any error that occurred during the verification process from the Clerk API. |
externalVerificationRedirectURL | URL | null | If this is a verification that is based on an external account (usually oauth_*), this is the URL that the user will be redirected to after the verification is completed. |