Passer au contenu principal
POST
https://{tenantDomain}/api/v2
/
connections
/
{id}
/
scim-configuration
/
tokens
Go
package example

import (
    context "context"

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

func do() {
    client := client.NewClient(
        option.WithToken(
            "<token>",
        ),
    )
    request := &scimconfiguration.CreateScimTokenRequestContent{}
    client.Connections.ScimConfiguration.Tokens.Create(
        context.TODO(),
        "id",
        request,
    )
}
import { ManagementClient } from "auth0";

async function main() {
    const client = new ManagementClient({
        token: "<token>",
    });
    await client.connections.scimConfiguration.tokens.create("id", {});
}
main();
import { ManagementClient } from "auth0";

async function main() {
    const client = new ManagementClient({
        token: "<token>",
    });
    await client.connections.scimConfiguration.tokens.create("id", {});
}
main();
curl --request POST \
  --url https://{tenantDomain}/api/v2/connections/{id}/scim-configuration/tokens \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "scopes": [
    "<string>"
  ],
  "token_lifetime": 123
}
'
import requests

url = "https://{tenantDomain}/api/v2/connections/{id}/scim-configuration/tokens"

payload = {
    "scopes": ["<string>"],
    "token_lifetime": 123
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://{tenantDomain}/api/v2/connections/{id}/scim-configuration/tokens",
  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([
    'scopes' => [
        '<string>'
    ],
    'token_lifetime' => 123
  ]),
  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;
}
HttpResponse<String> response = Unirest.post("https://{tenantDomain}/api/v2/connections/{id}/scim-configuration/tokens")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"scopes\": [\n    \"<string>\"\n  ],\n  \"token_lifetime\": 123\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://{tenantDomain}/api/v2/connections/{id}/scim-configuration/tokens")

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  \"scopes\": [\n    \"<string>\"\n  ],\n  \"token_lifetime\": 123\n}"

response = http.request(request)
puts response.read_body
{
  "token_id": "<string>",
  "token": "<string>",
  "scopes": [
    "<string>"
  ],
  "created_at": "<string>",
  "valid_until": "<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

The id of the connection to create its SCIM token

Corps

SCIM Token

scopes
string[]

The scopes of the scim token

Minimum array length: 1

The token's scope

token_lifetime
integer | null

Lifetime of the token in seconds. Must be greater than 900

Réponse

The connection's SCIM token was created. See Response Schemas for schema.

token_id
string

The token's identifier

token
string

The scim client's token

scopes
string[]

The scopes of the scim token

The token's scope

created_at
string

The token's created at timestamp

valid_until
string

The token's valid until at timestamp