Passer au contenu principal
POST
/
identity-providers
Create an Identity Provider
curl --request POST \
  --url https://{tenantDomain}/my-org/v1/identity-providers \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "oidcIdp",
  "display_name": "OIDC IdP",
  "strategy": "oidc",
  "show_as_button": true,
  "assign_membership_on_login": false,
  "domains": [
    "mydomain.com"
  ],
  "is_enabled": true,
  "options": {
    "type": "front_channel",
    "client_id": "a8f3b2e7-5d1c-4f9a-8b0d-2e1c3a5b6f7d",
    "client_secret": "KzQp2sVxR8nTgMjFhYcEWuLoIbDvUoC6A9B1zX7yWqFjHkGrP5sQdLmNp",
    "discovery_url": "https://{yourDomain}/.well-known/openid-configuration"
  }
}
'
import requests

url = "https://{tenantDomain}/my-org/v1/identity-providers"

payload = {
"name": "oidcIdp",
"display_name": "OIDC IdP",
"strategy": "oidc",
"show_as_button": True,
"assign_membership_on_login": False,
"domains": ["mydomain.com"],
"is_enabled": True,
"options": {
"type": "front_channel",
"client_id": "a8f3b2e7-5d1c-4f9a-8b0d-2e1c3a5b6f7d",
"client_secret": "KzQp2sVxR8nTgMjFhYcEWuLoIbDvUoC6A9B1zX7yWqFjHkGrP5sQdLmNp",
"discovery_url": "https://{yourDomain}/.well-known/openid-configuration"
}
}
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({
name: 'oidcIdp',
display_name: 'OIDC IdP',
strategy: 'oidc',
show_as_button: true,
assign_membership_on_login: false,
domains: ['mydomain.com'],
is_enabled: true,
options: {
type: 'front_channel',
client_id: 'a8f3b2e7-5d1c-4f9a-8b0d-2e1c3a5b6f7d',
client_secret: 'KzQp2sVxR8nTgMjFhYcEWuLoIbDvUoC6A9B1zX7yWqFjHkGrP5sQdLmNp',
discovery_url: 'https://{yourDomain}/.well-known/openid-configuration'
}
})
};

fetch('https://{tenantDomain}/my-org/v1/identity-providers', 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://{tenantDomain}/my-org/v1/identity-providers",
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([
'name' => 'oidcIdp',
'display_name' => 'OIDC IdP',
'strategy' => 'oidc',
'show_as_button' => true,
'assign_membership_on_login' => false,
'domains' => [
'mydomain.com'
],
'is_enabled' => true,
'options' => [
'type' => 'front_channel',
'client_id' => 'a8f3b2e7-5d1c-4f9a-8b0d-2e1c3a5b6f7d',
'client_secret' => 'KzQp2sVxR8nTgMjFhYcEWuLoIbDvUoC6A9B1zX7yWqFjHkGrP5sQdLmNp',
'discovery_url' => 'https://{yourDomain}/.well-known/openid-configuration'
]
]),
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://{tenantDomain}/my-org/v1/identity-providers"

payload := strings.NewReader("{\n \"name\": \"oidcIdp\",\n \"display_name\": \"OIDC IdP\",\n \"strategy\": \"oidc\",\n \"show_as_button\": true,\n \"assign_membership_on_login\": false,\n \"domains\": [\n \"mydomain.com\"\n ],\n \"is_enabled\": true,\n \"options\": {\n \"type\": \"front_channel\",\n \"client_id\": \"a8f3b2e7-5d1c-4f9a-8b0d-2e1c3a5b6f7d\",\n \"client_secret\": \"KzQp2sVxR8nTgMjFhYcEWuLoIbDvUoC6A9B1zX7yWqFjHkGrP5sQdLmNp\",\n \"discovery_url\": \"https://{yourDomain}/.well-known/openid-configuration\"\n }\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://{tenantDomain}/my-org/v1/identity-providers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"oidcIdp\",\n \"display_name\": \"OIDC IdP\",\n \"strategy\": \"oidc\",\n \"show_as_button\": true,\n \"assign_membership_on_login\": false,\n \"domains\": [\n \"mydomain.com\"\n ],\n \"is_enabled\": true,\n \"options\": {\n \"type\": \"front_channel\",\n \"client_id\": \"a8f3b2e7-5d1c-4f9a-8b0d-2e1c3a5b6f7d\",\n \"client_secret\": \"KzQp2sVxR8nTgMjFhYcEWuLoIbDvUoC6A9B1zX7yWqFjHkGrP5sQdLmNp\",\n \"discovery_url\": \"https://{yourDomain}/.well-known/openid-configuration\"\n }\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://{tenantDomain}/my-org/v1/identity-providers")

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 \"name\": \"oidcIdp\",\n \"display_name\": \"OIDC IdP\",\n \"strategy\": \"oidc\",\n \"show_as_button\": true,\n \"assign_membership_on_login\": false,\n \"domains\": [\n \"mydomain.com\"\n ],\n \"is_enabled\": true,\n \"options\": {\n \"type\": \"front_channel\",\n \"client_id\": \"a8f3b2e7-5d1c-4f9a-8b0d-2e1c3a5b6f7d\",\n \"client_secret\": \"KzQp2sVxR8nTgMjFhYcEWuLoIbDvUoC6A9B1zX7yWqFjHkGrP5sQdLmNp\",\n \"discovery_url\": \"https://{yourDomain}/.well-known/openid-configuration\"\n }\n}"

response = http.request(request)
puts response.read_body
{
  "id": "con_zW1UHutvkVWSWdCC",
  "name": "oidcIdp",
  "display_name": "OIDC IdP",
  "strategy": "oidc",
  "show_as_button": true,
  "assign_membership_on_login": false,
  "access_level": "full",
  "domains": [
    "mydomain.com"
  ],
  "is_enabled": true,
  "options": {
    "type": "front_channel",
    "client_id": "client_a8f3b2e7-5d1c-4f9a-8b0d-2e1c3a5b6f7did",
    "discovery_url": "https://{yourDomain}/.well-known/openid-configuration"
  },
  "attributes": [
    {
      "sso_field": [
        "userName"
      ],
      "user_attribute": "preferred_username",
      "description": "Preferred Username",
      "label": "Preferred username",
      "is_required": true,
      "is_extra": false,
      "is_missing": false
    },
    {
      "sso_field": [
        "externalId"
      ],
      "user_attribute": "external_id",
      "is_required": true,
      "is_extra": true,
      "is_missing": false
    }
  ]
}

Autorisations

Authorization
string
header
requis

The access token received from the authorization server in the OAuth 2.0 flow.

Corps

application/json

Identity provider specific options.

name
string
requis

The name of the identity provider

Required string length: 1 - 128
strategy
enum<string>
requis

The type of the identity provider

Options disponibles:
adfs,
google-apps,
oidc,
okta,
pingfederate,
samlp,
waad
Allowed value: "adfs"
options
adfs_server · object
requis

Identity provider specific options.

domains
string[]

List of domains for Home Realm Discovery (HRD)

display_name
string

Identity provider name used on the login screen.

Required string length: 1 - 128
show_as_button
boolean

Enables showing a button for the connection in the login page (new experience only). If false, it will be usable only by Home Realm Discovery (HRD).

assign_membership_on_login
boolean

If true, the user will be made a member of the organization upon login.

is_enabled
boolean

True if the identity provider is enabled for the organization.

Réponse

Identity provider successfully created.

Identity provider specific options.

strategy
enum<string>
requis

The type of the identity provider

Options disponibles:
adfs,
google-apps,
oidc,
okta,
pingfederate,
samlp,
waad
Allowed value: "adfs"
options
adfs_server · object
requis

Identity provider specific options.

id
string
read-only

Identity provider identifier.

Pattern: ^con_[A-Za-z0-9]{16}$
name
string | null

The name of the identity provider

Maximum string length: 128
domains
string[]

List of domains for Home Realm Discovery (HRD)

display_name
string

Identity provider name used on the login screen.

Required string length: 1 - 128
show_as_button
boolean

Enables showing a button for the connection in the login page (new experience only). If false, it will be usable only by Home Realm Discovery (HRD).

assign_membership_on_login
boolean

If true, the user will be made a member of the organization upon login.

is_enabled
boolean

True if the identity provider is enabled for the organization.

access_level
enum<string>
read-only

The access level allowed for the Organization

Options disponibles:
none,
readonly,
limited,
full