Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/appwrite/mod.ts>Account#createOAuth2Token

[READ-ONLY] Official Appwrite Deno SDK 🦕
Latest
method Account.prototype.createOAuth2Token
Re-export
import { Account } from "https://deno.land/x/appwrite@12.1.0/mod.ts";

Create OAuth2 token

Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed.

If authentication succeeds, userId and secret of a token will be appended to the success URL as query parameters. These can be used to create a new session using the Create session endpoint.

A user is limited to 10 active sessions at a time by default. Learn more about session limits.

Parameters

provider: OAuthProvider
optional
success: string
optional
failure: string
optional
scopes: string[]

Returns

Promise<string>