using Auth0.ManagementApi;
using System.Threading.Tasks;
using Auth0.ManagementApi.Organizations;
public partial class Examples
{
public async Task Example() {
var client = new ManagementApiClient(
token: "<token>",
clientOptions: new ClientOptions { BaseUrl = "https://{YOUR_DOMAIN}/api/v2" }
);
await client.Organizations.EnabledConnections.AddAsync(
id: "id",
request: new AddOrganizationConnectionRequestContent {
ConnectionId = "connection_id"
}
);
}
}package example
import (
context "context"
management "github.com/auth0/go-auth0/v3/management"
client "github.com/auth0/go-auth0/v3/management/client"
option "github.com/auth0/go-auth0/v3/management/option"
)
func do() {
mgmt, err := client.New(
"{YOUR_DOMAIN}",
option.WithToken(
"<token>",
),
)
if err != nil {
return
}
request := &management.AddOrganizationConnectionRequestContent{
ConnectionId: "connection_id",
}
mgmt.Organizations.EnabledConnections.Add(
context.TODO(),
"id",
request,
)
}
package com.example.usage;
import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.organizations.types.AddOrganizationConnectionRequestContent;
public class Example {
public static void main(String[] args) {
ManagementApi client = ManagementApi
.builder()
.domain("{YOUR_DOMAIN}")
.token("<token>")
.build();
client.organizations().enabledConnections().add(
"id",
AddOrganizationConnectionRequestContent
.builder()
.connectionId("connection_id")
.build()
);
}
}<?php
namespace Example;
use Auth0\SDK\API\Management\Wrapper\ManagementClient;
use Auth0\SDK\API\Management\Wrapper\ManagementClientOptions;
use Auth0\SDK\API\Management\Organizations\EnabledConnections\Requests\AddOrganizationConnectionRequestContent;
$client = new ManagementClient(new ManagementClientOptions(
domain: '{YOUR_DOMAIN}',
token: '<token>',
));
$client->organizations->enabledConnections->add(
'id',
new AddOrganizationConnectionRequestContent([
'connectionId' => 'connection_id',
]),
);
from auth0.management import ManagementClient
client = ManagementClient(
domain="{YOUR_DOMAIN}",
token="<token>",
)
client.organizations.enabled_connections.add(
id="id",
connection_id="connection_id",
)
require "auth0"
client = Auth0::Management.new(token: "<token>", base_url: "https://{YOUR_DOMAIN}/api/v2")
client.organizations.enabled_connections.add(
id: "id",
connection_id: "connection_id"
)
import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
domain: "{YOUR_DOMAIN}",
token: "<token>",
});
await client.organizations.enabledConnections.add("id", {
connectionId: "connection_id",
});
}
main();
import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
domain: "{YOUR_DOMAIN}",
token: "<token>",
});
await client.organizations.enabledConnections.add("id", {
connectionId: "connection_id",
});
}
main();
curl --request POST \
--url https://{tenantDomain}/api/v2/organizations/{id}/enabled_connections \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"connection_id": "<string>",
"assign_membership_on_login": true,
"is_signup_enabled": true,
"show_as_button": true
}
'{
"assign_membership_on_login": true,
"connection": {
"name": "<string>",
"strategy": "<string>"
},
"connection_id": "<string>",
"is_signup_enabled": true,
"show_as_button": true
}有効な接続をPOST
指定した Organization に対して特定の接続を有効にします。接続を有効にするには、その接続が tenant 内にすでに存在している必要があります。この操作で接続を作成することはできません。
接続 は、Auth0 とユーザーソースの関係を表します。利用可能な接続の種類には、データベース、Enterprise、Social があります。
using Auth0.ManagementApi;
using System.Threading.Tasks;
using Auth0.ManagementApi.Organizations;
public partial class Examples
{
public async Task Example() {
var client = new ManagementApiClient(
token: "<token>",
clientOptions: new ClientOptions { BaseUrl = "https://{YOUR_DOMAIN}/api/v2" }
);
await client.Organizations.EnabledConnections.AddAsync(
id: "id",
request: new AddOrganizationConnectionRequestContent {
ConnectionId = "connection_id"
}
);
}
}package example
import (
context "context"
management "github.com/auth0/go-auth0/v3/management"
client "github.com/auth0/go-auth0/v3/management/client"
option "github.com/auth0/go-auth0/v3/management/option"
)
func do() {
mgmt, err := client.New(
"{YOUR_DOMAIN}",
option.WithToken(
"<token>",
),
)
if err != nil {
return
}
request := &management.AddOrganizationConnectionRequestContent{
ConnectionId: "connection_id",
}
mgmt.Organizations.EnabledConnections.Add(
context.TODO(),
"id",
request,
)
}
package com.example.usage;
import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.organizations.types.AddOrganizationConnectionRequestContent;
public class Example {
public static void main(String[] args) {
ManagementApi client = ManagementApi
.builder()
.domain("{YOUR_DOMAIN}")
.token("<token>")
.build();
client.organizations().enabledConnections().add(
"id",
AddOrganizationConnectionRequestContent
.builder()
.connectionId("connection_id")
.build()
);
}
}<?php
namespace Example;
use Auth0\SDK\API\Management\Wrapper\ManagementClient;
use Auth0\SDK\API\Management\Wrapper\ManagementClientOptions;
use Auth0\SDK\API\Management\Organizations\EnabledConnections\Requests\AddOrganizationConnectionRequestContent;
$client = new ManagementClient(new ManagementClientOptions(
domain: '{YOUR_DOMAIN}',
token: '<token>',
));
$client->organizations->enabledConnections->add(
'id',
new AddOrganizationConnectionRequestContent([
'connectionId' => 'connection_id',
]),
);
from auth0.management import ManagementClient
client = ManagementClient(
domain="{YOUR_DOMAIN}",
token="<token>",
)
client.organizations.enabled_connections.add(
id="id",
connection_id="connection_id",
)
require "auth0"
client = Auth0::Management.new(token: "<token>", base_url: "https://{YOUR_DOMAIN}/api/v2")
client.organizations.enabled_connections.add(
id: "id",
connection_id: "connection_id"
)
import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
domain: "{YOUR_DOMAIN}",
token: "<token>",
});
await client.organizations.enabledConnections.add("id", {
connectionId: "connection_id",
});
}
main();
import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
domain: "{YOUR_DOMAIN}",
token: "<token>",
});
await client.organizations.enabledConnections.add("id", {
connectionId: "connection_id",
});
}
main();
curl --request POST \
--url https://{tenantDomain}/api/v2/organizations/{id}/enabled_connections \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"connection_id": "<string>",
"assign_membership_on_login": true,
"is_signup_enabled": true,
"show_as_button": true
}
'{
"assign_membership_on_login": true,
"connection": {
"name": "<string>",
"strategy": "<string>"
},
"connection_id": "<string>",
"is_signup_enabled": true,
"show_as_button": true
}承認
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
パスパラメータ
organization識別子。
50ボディ
organization に追加する単一の接続ID。
true の場合、この接続でログインするすべてのユーザーに organization のメンバーシップが自動的に付与されます。false の場合、ユーザーはこの接続でログインする前に、organization のメンバーシップを付与されている必要があります。
この organization 接続で organization signup を有効にするかどうかを指定します。データベース接続にのみ適用されます。既定値: false。
この organization の login prompt に接続を表示するかどうかを指定します。エンタープライズ接続にのみ適用されます。既定値: true。
レスポンス
organization接続が正常に追加されました。
true の場合、この接続でログインするすべてのユーザーに organization のメンバーシップが自動的に付与されます。false の場合、ユーザーはこの接続でログインする前に、organization のメンバーシップを付与されている必要があります。
Show child attributes
Show child attributes
接続のID。
この organization 接続で organization signup を有効にするかどうかを指定します。データベース接続にのみ適用されます。既定値: false。
この organization の login prompt に接続を表示するかどうかを指定します。エンタープライズ接続にのみ適用されます。既定値: true。