Passer au contenu principal
POST
https://{tenantDomain}/api/v2
/
users
/
{id}
/
identities
Go
package example

import (
    client "github.com/auth0/go-auth0/management/client"
    option "github.com/auth0/go-auth0/management/option"
    context "context"
    users "github.com/auth0/go-auth0/management/users"
)

func do() () {
    client := client.NewClient(
        option.WithToken(
            "<token>",
        ),
    )
    client.Users.Identities.Link(
        context.TODO(),
        "id",
        &users.LinkUserIdentityRequestContent{},
    )
}
[
  {
    "connection": "twitter",
    "user_id": "abc",
    "provider": "twitter",
    "profileData": {
      "email": "<string>",
      "email_verified": true,
      "name": "<string>",
      "username": "johndoe",
      "given_name": "<string>",
      "phone_number": "<string>",
      "phone_verified": true,
      "family_name": "<string>"
    },
    "isSocial": true,
    "access_token": "<string>",
    "access_token_secret": "<string>",
    "refresh_token": "<string>"
  }
]

Autorisations

Authorization
string
header
requis

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Paramètres de chemin

id
string
requis

ID of the primary user account to link a second user account to.

Corps

provider
enum<string>

Identity provider of the secondary user account being linked.

Options disponibles:
ad,
adfs,
amazon,
apple,
dropbox,
bitbucket,
aol,
auth0-oidc,
auth0,
baidu,
bitly,
box,
custom,
daccount,
dwolla,
email,
evernote-sandbox,
evernote,
exact,
facebook,
fitbit,
flickr,
github,
google-apps,
google-oauth2,
instagram,
ip,
line,
linkedin,
oauth1,
oauth2,
office365,
oidc,
okta,
paypal,
paypal-sandbox,
pingfederate,
planningcenter,
salesforce-community,
salesforce-sandbox,
salesforce,
samlp,
sharepoint,
shopify,
shop,
sms,
soundcloud,
thirtysevensignals,
twitter,
untappd,
vkontakte,
waad,
weibo,
windowslive,
wordpress,
yahoo,
yandex
connection_id
string

connection_id of the secondary user account being linked when more than one auth0 database provider exists.

Pattern: ^con_[A-Za-z0-9]{16}$
user_id
défaut:abc

user_id of the secondary user account being linked.

Minimum string length: 1

JWT for the secondary account being linked. If sending this parameter, provider, user_id, and connection_id must not be sent.

Réponse

Identity successfully added.

connection
string
défaut:twitter
requis

Connection name of this identity.

user_id
défaut:abc
requis

user_id of this identity.

Minimum string length: 1
provider
string
défaut:twitter
requis

Type of identity provider.

profileData
object
isSocial
boolean

Whether the identity provider is a social provider (true) or not (false).

access_token
string

IDP access token returned if scope read:user_idp_tokens is defined.

access_token_secret
string

IDP access token secret returned only if scope read:user_idp_tokens is defined.

refresh_token
string

IDP refresh token returned only if scope read:user_idp_tokens is defined.