メインコンテンツへスキップ
POST
/
connected-accounts
/
connect
TypeScript
import { MyAccountClient } from "github.com/auth0/myaccount-js";

async function main() {
    const client = new MyAccountClient({
        token: "<token>",
    });
    await client.connectedAccounts.create({
        connection: "connection",
        redirectUri: "redirect_uri",
    });
}
main();
{
  "connect_uri": "<string>",
  "auth_session": "<string>",
  "connect_params": {
    "ticket": "<string>"
  },
  "expires_in": 2
}

Release Lifecycle

Generally Available

Scopes

Scopes define permissions and access levels for API requests and authentication tokens.
create:me:connected_accounts

承認

Authorization
string
header
必須

Bearer and DPoP tokens are supported depending on the API configuration

ボディ

application/json

Request body for creating an account connection request.

connection
string
必須

The name of the connection to link the account with (e.g., 'google-oauth2', 'facebook').

Required string length: 1 - 128
redirect_uri
string<uri>
必須

The URI to redirect to after the connection process completes.

Maximum string length: 2048
state
string

An opaque value used to maintain state between the request and callback.

Required string length: 1 - 4096
code_challenge
string

The PKCE code challenge derived from the code verifier.

Required string length: 43 - 128
code_challenge_method
string

The method used to derive the code challenge. Required when code_challenge is provided.

Allowed value: "S256"
scopes
string[]

Defines the permissions that the client requests from the Identity Provider. Must include the standard scopes used to identify the user (e.g. 'openid', 'email', 'profile'), the scope required to obtain refresh tokens if needed (e.g. 'offline_access'), and any custom scopes the client needs to access protected resources.

Required array length: 1 - 100 elements
Required string length: 1 - 255
:
[
"openid",
"offline_access",
"read:tasks",
"write:tasks"
]
authorization_params
Authorization Parameters · object

Authorization parameters to be sent to the underlying Identity Provider (IdP) during the authorization request. These parameters influence how the IdP processes the authorization flow and what permissions are requested.

レスポンス

Account connection request created successfully

connect_uri
string<uri>
必須

The base URI to initiate the account connection flow.

auth_session
string
必須

The authentication session identifier.

Maximum string length: 64
connect_params
object
必須

Parameters to be used with the connect URI.

expires_in
integer
必須

The number of seconds until the ticket expires.

必須範囲: x >= 1