ExternalAccount
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 you can make sure they can be assigned to their rightful owners. The ExternalAccount
object holds all necessary state around the verification process.
Properties
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. google |
publicMetadata | object | Metadata provided about the user from the provider. |
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 | Verification | An object holding information on the verification of this external account. |
Methods
reauthorize()
function reauthorize(params: ReauthorizeExternalAccountParams): Promise<ExternalAccount>;
Invokes a re-authorization flow for an existing external account.
ReauthorizeExternalAccountParams
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. |
destroy()
function destroy(): Promise<void>;
Deletes this external account.
providerSlug()
function providerSlug(): string;
A getter method for the provider
attribute.
providerTitle()
function providerTitle(): string;
Returns the title of the provider with the word "Account" appended.
EG: if google
is passed as the parameter, Google Account
will be returned.
accountIdentifier()
function accountIdentifier(): string;
Returns the identifier of the account, which can be one of the following:
username
if presentemailAddress
if presentlabel