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

import (
    context "context"

    management "github.com/auth0/go-auth0/management/management"
    client "github.com/auth0/go-auth0/management/management/client"
    option "github.com/auth0/go-auth0/management/management/option"
)

func do() {
    client := client.NewClient(
        option.WithToken(
            "<token>",
        ),
    )
    client.Users.Identities.Delete(
        context.TODO(),
        "id",
        management.UserIdentityProviderEnumAd.Ptr(),
        "user_id",
    )
}
import { ManagementClient } from "auth0";

async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.users.identities.delete("id", "ad", "user_id");
}
main();
import { ManagementClient } from "auth0";

async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.users.identities.delete("id", "ad", "user_id");
}
main();
curl --request DELETE \
--url https://{tenantDomain}/api/v2/users/{id}/identities/{provider}/{user_id} \
--header 'Authorization: Bearer <token>'
import requests

url = "https://{tenantDomain}/api/v2/users/{id}/identities/{provider}/{user_id}"

headers = {"Authorization": "Bearer <token>"}

response = requests.delete(url, headers=headers)

print(response.text)
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://{tenantDomain}/api/v2/users/{id}/identities/{provider}/{user_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
HttpResponse<String> response = Unirest.delete("https://{tenantDomain}/api/v2/users/{id}/identities/{provider}/{user_id}")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://{tenantDomain}/api/v2/users/{id}/identities/{provider}/{user_id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
[
  {
    "connection": "Initial-Connection",
    "user_id": "abc",
    "provider": "auth0",
    "isSocial": true,
    "access_token": "<string>",
    "access_token_secret": "<string>",
    "refresh_token": "<string>",
    "profileData": {
      "email": "<string>",
      "email_verified": true,
      "name": "<string>",
      "username": "johndoe",
      "given_name": "<string>",
      "phone_number": "<string>",
      "phone_verified": true,
      "family_name": "<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.

provider
enum<string>
requis

Identity provider name of the secondary linked account (e.g. google-oauth2). The type of identity provider

Options disponibles:
ad,
adfs,
amazon,
apple,
dropbox,
bitbucket,
auth0-oidc,
auth0,
baidu,
bitly,
box,
custom,
daccount,
dwolla,
email,
evernote-sandbox,
evernote,
exact,
facebook,
fitbit,
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
user_id
string
requis

ID of the secondary linked account (e.g. 123456789081523216417 part after the | in google-oauth2|123456789081523216417).

Réponse

User identity successfully unlinked.

connection
string
défaut:Initial-Connection
requis

The name of the connection for the identity.

user_id
défaut:abc
requis

The unique identifier for the user for the identity.

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

The type of identity provider.

isSocial
boolean

true if the identity provider is a social provider, falses otherwise

access_token
string

IDP access token returned only 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.

profileData
object