curl --request POST \
--url https://{host}/me/v1/connected-accounts/connect \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"connection": "<string>",
"redirect_uri": "<string>",
"authorization_params": {
"acr_values": "<string>",
"audience": "<string>",
"id_token_hint": "<string>",
"login_hint": "<string>",
"max_age": 1073741823,
"resource": "<string>",
"ui_locales": "<string>"
},
"code_challenge": "<string>",
"code_challenge_method": "<string>",
"scopes": [
"openid",
"offline_access",
"read:tasks",
"write:tasks"
],
"state": "<string>"
}
'import requests
url = "https://{host}/me/v1/connected-accounts/connect"
payload = {
"connection": "<string>",
"redirect_uri": "<string>",
"authorization_params": {
"acr_values": "<string>",
"audience": "<string>",
"id_token_hint": "<string>",
"login_hint": "<string>",
"max_age": 1073741823,
"resource": "<string>",
"ui_locales": "<string>"
},
"code_challenge": "<string>",
"code_challenge_method": "<string>",
"scopes": ["openid", "offline_access", "read:tasks", "write:tasks"],
"state": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
connection: '<string>',
redirect_uri: '<string>',
authorization_params: {
acr_values: '<string>',
audience: '<string>',
id_token_hint: '<string>',
login_hint: '<string>',
max_age: 1073741823,
resource: '<string>',
ui_locales: '<string>'
},
code_challenge: '<string>',
code_challenge_method: '<string>',
scopes: ['openid', 'offline_access', 'read:tasks', 'write:tasks'],
state: '<string>'
})
};
fetch('https://{host}/me/v1/connected-accounts/connect', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{host}/me/v1/connected-accounts/connect",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'connection' => '<string>',
'redirect_uri' => '<string>',
'authorization_params' => [
'acr_values' => '<string>',
'audience' => '<string>',
'id_token_hint' => '<string>',
'login_hint' => '<string>',
'max_age' => 1073741823,
'resource' => '<string>',
'ui_locales' => '<string>'
],
'code_challenge' => '<string>',
'code_challenge_method' => '<string>',
'scopes' => [
'openid',
'offline_access',
'read:tasks',
'write:tasks'
],
'state' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{host}/me/v1/connected-accounts/connect"
payload := strings.NewReader("{\n \"connection\": \"<string>\",\n \"redirect_uri\": \"<string>\",\n \"authorization_params\": {\n \"acr_values\": \"<string>\",\n \"audience\": \"<string>\",\n \"id_token_hint\": \"<string>\",\n \"login_hint\": \"<string>\",\n \"max_age\": 1073741823,\n \"resource\": \"<string>\",\n \"ui_locales\": \"<string>\"\n },\n \"code_challenge\": \"<string>\",\n \"code_challenge_method\": \"<string>\",\n \"scopes\": [\n \"openid\",\n \"offline_access\",\n \"read:tasks\",\n \"write:tasks\"\n ],\n \"state\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{host}/me/v1/connected-accounts/connect")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"connection\": \"<string>\",\n \"redirect_uri\": \"<string>\",\n \"authorization_params\": {\n \"acr_values\": \"<string>\",\n \"audience\": \"<string>\",\n \"id_token_hint\": \"<string>\",\n \"login_hint\": \"<string>\",\n \"max_age\": 1073741823,\n \"resource\": \"<string>\",\n \"ui_locales\": \"<string>\"\n },\n \"code_challenge\": \"<string>\",\n \"code_challenge_method\": \"<string>\",\n \"scopes\": [\n \"openid\",\n \"offline_access\",\n \"read:tasks\",\n \"write:tasks\"\n ],\n \"state\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/me/v1/connected-accounts/connect")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"connection\": \"<string>\",\n \"redirect_uri\": \"<string>\",\n \"authorization_params\": {\n \"acr_values\": \"<string>\",\n \"audience\": \"<string>\",\n \"id_token_hint\": \"<string>\",\n \"login_hint\": \"<string>\",\n \"max_age\": 1073741823,\n \"resource\": \"<string>\",\n \"ui_locales\": \"<string>\"\n },\n \"code_challenge\": \"<string>\",\n \"code_challenge_method\": \"<string>\",\n \"scopes\": [\n \"openid\",\n \"offline_access\",\n \"read:tasks\",\n \"write:tasks\"\n ],\n \"state\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"auth_session": "<string>",
"connect_params": {
"ticket": "<string>"
},
"connect_uri": "<string>",
"expires_in": 2
}{
"detail": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"validation_errors": [
{
"detail": "<string>",
"field": "<string>",
"pointer": "<string>",
"source": "<string>"
}
]
}{
"detail": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"validation_errors": [
{
"detail": "<string>",
"field": "<string>",
"pointer": "<string>",
"source": "<string>"
}
]
}{
"detail": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"validation_errors": [
{
"detail": "<string>",
"field": "<string>",
"pointer": "<string>",
"source": "<string>"
}
]
}{
"detail": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"validation_errors": [
{
"detail": "<string>",
"field": "<string>",
"pointer": "<string>",
"source": "<string>"
}
]
}{
"detail": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"validation_errors": [
{
"detail": "<string>",
"field": "<string>",
"pointer": "<string>",
"source": "<string>"
}
]
}Requête de création d’un compte connecté
Démarrer un flux d’autorisation pour lier le compte de l’utilisateur authentifié à un fournisseur d’identité externe.
curl --request POST \
--url https://{host}/me/v1/connected-accounts/connect \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"connection": "<string>",
"redirect_uri": "<string>",
"authorization_params": {
"acr_values": "<string>",
"audience": "<string>",
"id_token_hint": "<string>",
"login_hint": "<string>",
"max_age": 1073741823,
"resource": "<string>",
"ui_locales": "<string>"
},
"code_challenge": "<string>",
"code_challenge_method": "<string>",
"scopes": [
"openid",
"offline_access",
"read:tasks",
"write:tasks"
],
"state": "<string>"
}
'import requests
url = "https://{host}/me/v1/connected-accounts/connect"
payload = {
"connection": "<string>",
"redirect_uri": "<string>",
"authorization_params": {
"acr_values": "<string>",
"audience": "<string>",
"id_token_hint": "<string>",
"login_hint": "<string>",
"max_age": 1073741823,
"resource": "<string>",
"ui_locales": "<string>"
},
"code_challenge": "<string>",
"code_challenge_method": "<string>",
"scopes": ["openid", "offline_access", "read:tasks", "write:tasks"],
"state": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
connection: '<string>',
redirect_uri: '<string>',
authorization_params: {
acr_values: '<string>',
audience: '<string>',
id_token_hint: '<string>',
login_hint: '<string>',
max_age: 1073741823,
resource: '<string>',
ui_locales: '<string>'
},
code_challenge: '<string>',
code_challenge_method: '<string>',
scopes: ['openid', 'offline_access', 'read:tasks', 'write:tasks'],
state: '<string>'
})
};
fetch('https://{host}/me/v1/connected-accounts/connect', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{host}/me/v1/connected-accounts/connect",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'connection' => '<string>',
'redirect_uri' => '<string>',
'authorization_params' => [
'acr_values' => '<string>',
'audience' => '<string>',
'id_token_hint' => '<string>',
'login_hint' => '<string>',
'max_age' => 1073741823,
'resource' => '<string>',
'ui_locales' => '<string>'
],
'code_challenge' => '<string>',
'code_challenge_method' => '<string>',
'scopes' => [
'openid',
'offline_access',
'read:tasks',
'write:tasks'
],
'state' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{host}/me/v1/connected-accounts/connect"
payload := strings.NewReader("{\n \"connection\": \"<string>\",\n \"redirect_uri\": \"<string>\",\n \"authorization_params\": {\n \"acr_values\": \"<string>\",\n \"audience\": \"<string>\",\n \"id_token_hint\": \"<string>\",\n \"login_hint\": \"<string>\",\n \"max_age\": 1073741823,\n \"resource\": \"<string>\",\n \"ui_locales\": \"<string>\"\n },\n \"code_challenge\": \"<string>\",\n \"code_challenge_method\": \"<string>\",\n \"scopes\": [\n \"openid\",\n \"offline_access\",\n \"read:tasks\",\n \"write:tasks\"\n ],\n \"state\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{host}/me/v1/connected-accounts/connect")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"connection\": \"<string>\",\n \"redirect_uri\": \"<string>\",\n \"authorization_params\": {\n \"acr_values\": \"<string>\",\n \"audience\": \"<string>\",\n \"id_token_hint\": \"<string>\",\n \"login_hint\": \"<string>\",\n \"max_age\": 1073741823,\n \"resource\": \"<string>\",\n \"ui_locales\": \"<string>\"\n },\n \"code_challenge\": \"<string>\",\n \"code_challenge_method\": \"<string>\",\n \"scopes\": [\n \"openid\",\n \"offline_access\",\n \"read:tasks\",\n \"write:tasks\"\n ],\n \"state\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/me/v1/connected-accounts/connect")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"connection\": \"<string>\",\n \"redirect_uri\": \"<string>\",\n \"authorization_params\": {\n \"acr_values\": \"<string>\",\n \"audience\": \"<string>\",\n \"id_token_hint\": \"<string>\",\n \"login_hint\": \"<string>\",\n \"max_age\": 1073741823,\n \"resource\": \"<string>\",\n \"ui_locales\": \"<string>\"\n },\n \"code_challenge\": \"<string>\",\n \"code_challenge_method\": \"<string>\",\n \"scopes\": [\n \"openid\",\n \"offline_access\",\n \"read:tasks\",\n \"write:tasks\"\n ],\n \"state\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"auth_session": "<string>",
"connect_params": {
"ticket": "<string>"
},
"connect_uri": "<string>",
"expires_in": 2
}{
"detail": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"validation_errors": [
{
"detail": "<string>",
"field": "<string>",
"pointer": "<string>",
"source": "<string>"
}
]
}{
"detail": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"validation_errors": [
{
"detail": "<string>",
"field": "<string>",
"pointer": "<string>",
"source": "<string>"
}
]
}{
"detail": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"validation_errors": [
{
"detail": "<string>",
"field": "<string>",
"pointer": "<string>",
"source": "<string>"
}
]
}{
"detail": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"validation_errors": [
{
"detail": "<string>",
"field": "<string>",
"pointer": "<string>",
"source": "<string>"
}
]
}{
"detail": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"validation_errors": [
{
"detail": "<string>",
"field": "<string>",
"pointer": "<string>",
"source": "<string>"
}
]
}Autorisations
Les jetons Bearer et DPoP sont pris en charge selon la configuration de l’API
Corps
Corps de la requête pour créer une requête de liaison de compte.
Le nom de la connexion à lier au compte (p. ex., 'google-oauth2', 'facebook').
1 - 128L’URI de redirection à utiliser une fois le processus de connexion terminé.
2048Paramètres d’autorisation à envoyer au fournisseur d’identité (IdP) sous-jacent durant la requête d’autorisation. Ces paramètres influencent la façon dont l’IdP traite le flux d’autorisation et les permissions demandées.
Show child attributes
Show child attributes
Le code challenge PKCE dérivé du code verifier.
43 - 128La méthode utilisée pour dériver le code challenge. Obligatoire lorsque code_challenge est fourni.
"S256"Définit les permissions que le client demande au fournisseur d’identité. Doit inclure les scopes standard utilisés pour identifier l’utilisateur (p. ex. 'openid', 'email', 'profile'), le scope requis pour obtenir des refresh tokens au besoin (p. ex. 'offline_access'), ainsi que tout scope personnalisé dont le client a besoin pour accéder à des ressources protégées.
1 - 100 elements1 - 255[
"openid",
"offline_access",
"read:tasks",
"write:tasks"
]
Une valeur opaque utilisée pour maintenir l’état entre la requête et le callback.
1 - 4096Réponse
Requête de liaison de compte créée avec succès
L’identifiant de session d’authentification.
64Paramètres à utiliser avec l’URI de connexion.
Show child attributes
Show child attributes
L’URI de base pour lancer le flux de liaison de compte.
Le nombre de secondes avant l’expiration du ticket.
x >= 1