using Auth0.ManagementApi;
using System.Threading.Tasks;
using Auth0.ManagementApi.Organizations;
using System.Collections.Generic;
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.ClientGrants.ListAsync(
id: "id",
request: new ListOrganizationClientGrantsRequestParameters {
Audience = "audience",
ClientId = "client_id",
GrantIds = new List<string>(){
"grant_ids",
}
,
Page = 1,
PerPage = 1,
IncludeTotals = true
}
);
}
}package example
import (
context "context"
management "github.com/auth0/go-auth0/v2/management"
client "github.com/auth0/go-auth0/v2/management/client"
option "github.com/auth0/go-auth0/v2/management/option"
organizations "github.com/auth0/go-auth0/v2/management/organizations"
)
func do() {
mgmt, err := client.New(
"{YOUR_DOMAIN}",
option.WithToken(
"<token>",
),
)
if err != nil {
return
}
request := &organizations.ListOrganizationClientGrantsRequestParameters{
Audience: management.String(
"audience",
),
ClientId: management.String(
"client_id",
),
Page: management.Int(
1,
),
PerPage: management.Int(
1,
),
IncludeTotals: management.Bool(
true,
),
}
mgmt.Organizations.ClientGrants.List(
context.TODO(),
"id",
request,
)
}package com.example.usage;
import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.organizations.types.ListOrganizationClientGrantsRequestParameters;
import java.util.Arrays;
public class Example {
public static void main(String[] args) {
ManagementApi client = ManagementApi
.builder()
.domain("{YOUR_DOMAIN}")
.token("<token>")
.build();
client.organizations().clientGrants().list(
"id",
ListOrganizationClientGrantsRequestParameters
.builder()
.grantIds(
Arrays.asList("grant_ids")
)
.audience("audience")
.clientId("client_id")
.page(1)
.perPage(1)
.includeTotals(true)
.build()
);
}
}<?php
namespace Example;
use Auth0\SDK\API\Management\Wrapper\ManagementClient;
use Auth0\SDK\API\Management\Wrapper\ManagementClientOptions;
use Auth0\SDK\API\Management\Organizations\ClientGrants\Requests\ListOrganizationClientGrantsRequestParameters;
$client = new ManagementClient(new ManagementClientOptions(
domain: '{YOUR_DOMAIN}',
token: '<token>',
));
$client->organizations->clientGrants->list(
'id',
new ListOrganizationClientGrantsRequestParameters([
'audience' => 'audience',
'clientId' => 'client_id',
'grantIds' => [
'grant_ids',
],
'page' => 1,
'perPage' => 1,
'includeTotals' => true,
]),
);from auth0.management import ManagementClient
client = ManagementClient(
domain="{YOUR_DOMAIN}",
token="<token>",
)
client.organizations.client_grants.list(
id="id",
audience="audience",
client_id="client_id",
grant_ids=[
"grant_ids"
],
page=1,
per_page=1,
include_totals=True,
)require "auth0"
client = Auth0::Management.new(token: "<token>", base_url: "https://{YOUR_DOMAIN}/api/v2")
client.organizations.client_grants.list(
id: "id",
audience: "audience",
client_id: "client_id",
grant_ids: ["grant_ids"],
page: 1,
per_page: 1,
include_totals: true
)import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
domain: "{YOUR_DOMAIN}",
token: "<token>",
});
await client.organizations.clientGrants.list("id", {
audience: "audience",
clientId: "client_id",
page: 1,
perPage: 1,
includeTotals: true,
});
}
main();import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
domain: "{YOUR_DOMAIN}",
token: "<token>",
});
await client.organizations.clientGrants.list("id", {
audience: "audience",
clientId: "client_id",
page: 1,
perPage: 1,
includeTotals: true,
});
}
main();curl --request GET \
--url https://{tenantDomain}/api/v2/organizations/{id}/client-grants \
--header 'Authorization: Bearer <token>'[
{
"id": "<string>",
"client_id": "<string>",
"audience": "<string>",
"scope": [
"<string>"
],
"allow_any_organization": true
}
]Get client grants associated to an organization
using Auth0.ManagementApi;
using System.Threading.Tasks;
using Auth0.ManagementApi.Organizations;
using System.Collections.Generic;
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.ClientGrants.ListAsync(
id: "id",
request: new ListOrganizationClientGrantsRequestParameters {
Audience = "audience",
ClientId = "client_id",
GrantIds = new List<string>(){
"grant_ids",
}
,
Page = 1,
PerPage = 1,
IncludeTotals = true
}
);
}
}package example
import (
context "context"
management "github.com/auth0/go-auth0/v2/management"
client "github.com/auth0/go-auth0/v2/management/client"
option "github.com/auth0/go-auth0/v2/management/option"
organizations "github.com/auth0/go-auth0/v2/management/organizations"
)
func do() {
mgmt, err := client.New(
"{YOUR_DOMAIN}",
option.WithToken(
"<token>",
),
)
if err != nil {
return
}
request := &organizations.ListOrganizationClientGrantsRequestParameters{
Audience: management.String(
"audience",
),
ClientId: management.String(
"client_id",
),
Page: management.Int(
1,
),
PerPage: management.Int(
1,
),
IncludeTotals: management.Bool(
true,
),
}
mgmt.Organizations.ClientGrants.List(
context.TODO(),
"id",
request,
)
}package com.example.usage;
import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.organizations.types.ListOrganizationClientGrantsRequestParameters;
import java.util.Arrays;
public class Example {
public static void main(String[] args) {
ManagementApi client = ManagementApi
.builder()
.domain("{YOUR_DOMAIN}")
.token("<token>")
.build();
client.organizations().clientGrants().list(
"id",
ListOrganizationClientGrantsRequestParameters
.builder()
.grantIds(
Arrays.asList("grant_ids")
)
.audience("audience")
.clientId("client_id")
.page(1)
.perPage(1)
.includeTotals(true)
.build()
);
}
}<?php
namespace Example;
use Auth0\SDK\API\Management\Wrapper\ManagementClient;
use Auth0\SDK\API\Management\Wrapper\ManagementClientOptions;
use Auth0\SDK\API\Management\Organizations\ClientGrants\Requests\ListOrganizationClientGrantsRequestParameters;
$client = new ManagementClient(new ManagementClientOptions(
domain: '{YOUR_DOMAIN}',
token: '<token>',
));
$client->organizations->clientGrants->list(
'id',
new ListOrganizationClientGrantsRequestParameters([
'audience' => 'audience',
'clientId' => 'client_id',
'grantIds' => [
'grant_ids',
],
'page' => 1,
'perPage' => 1,
'includeTotals' => true,
]),
);from auth0.management import ManagementClient
client = ManagementClient(
domain="{YOUR_DOMAIN}",
token="<token>",
)
client.organizations.client_grants.list(
id="id",
audience="audience",
client_id="client_id",
grant_ids=[
"grant_ids"
],
page=1,
per_page=1,
include_totals=True,
)require "auth0"
client = Auth0::Management.new(token: "<token>", base_url: "https://{YOUR_DOMAIN}/api/v2")
client.organizations.client_grants.list(
id: "id",
audience: "audience",
client_id: "client_id",
grant_ids: ["grant_ids"],
page: 1,
per_page: 1,
include_totals: true
)import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
domain: "{YOUR_DOMAIN}",
token: "<token>",
});
await client.organizations.clientGrants.list("id", {
audience: "audience",
clientId: "client_id",
page: 1,
perPage: 1,
includeTotals: true,
});
}
main();import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
domain: "{YOUR_DOMAIN}",
token: "<token>",
});
await client.organizations.clientGrants.list("id", {
audience: "audience",
clientId: "client_id",
page: 1,
perPage: 1,
includeTotals: true,
});
}
main();curl --request GET \
--url https://{tenantDomain}/api/v2/organizations/{id}/client-grants \
--header 'Authorization: Bearer <token>'[
{
"id": "<string>",
"client_id": "<string>",
"audience": "<string>",
"scope": [
"<string>"
],
"allow_any_organization": true
}
]承認
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
パスパラメータ
Organization identifier.
50クエリパラメータ
Optional filter on audience of the client grant.
600Optional filter on client_id of the client grant.
Optional filter on the ID of the client grant. Must be URL encoded and may be specified multiple times (max 10).
e.g. ../client-grants?grant_ids=id1&grant_ids=id2
Page index of the results to return. First page is 0.
x >= 0Number of results per page. Defaults to 50.
1 <= x <= 100Return results inside an object that contains the total result count (true) or as a direct array of results (false, default).
レスポンス
Client grants successfully retrieved.
- object[]
- object
ID of the client grant.
ID of the client.
The audience (API identifier) of this client grant
1Scopes allowed for this client grant.
1Defines whether organizations can be used with client credentials exchanges for this grant.
deny, allow, require If enabled, any organization can be used with this grant. If disabled (default), the grant must be explicitly assigned to the desired organizations.