Passer au contenu principal
GET
https://{tenantDomain}/api/v2
/
organizations
/
{id}
/
client-grants
C#
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 ManagementClient(
            token: "<token>"
        );

        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/management/management"
    client "github.com/auth0/go-auth0/management/management/client"
    option "github.com/auth0/go-auth0/management/management/option"
    organizations "github.com/auth0/go-auth0/management/management/organizations"
)

func do() {
    client := client.NewClient(
        option.WithToken(
            "<token>",
        ),
    )
    request := &organizations.ListOrganizationClientGrantsRequestParameters{
        Audience: management.String(
            "audience",
        ),
        ClientId: management.String(
            "client_id",
        ),
        Page: management.Int(
            1,
        ),
        PerPage: management.Int(
            1,
        ),
        IncludeTotals: management.Bool(
            true,
        ),
    }
    client.Organizations.ClientGrants.List(
        context.TODO(),
        "id",
        request,
    )
}
package com.example.usage;

import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.resources.organizations.clientgrants.requests.ListOrganizationClientGrantsRequestParameters;
import java.util.Arrays;

public class Example {
    public static void main(String[] args) {
        ManagementApi client = ManagementApi
            .builder()
            .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\Management;
use Auth0\SDK\API\Management\Organizations\ClientGrants\Requests\ListOrganizationClientGrantsRequestParameters;

$client = new Management(
    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(
    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>")

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({
        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({
        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
  }
]

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

Organization identifier.

Maximum string length: 50

Paramètres de requête

audience
string

Optional filter on audience of the client grant.

Maximum string length: 600
client_id
string

Optional filter on client_id of the client grant.

grant_ids
string<client-grant-id>[]

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
integer

Page index of the results to return. First page is 0.

Plage requise: x >= 0
per_page
integer

Number of results per page. Defaults to 50.

Plage requise: 1 <= x <= 100
include_totals
boolean

Return results inside an object that contains the total result count (true) or as a direct array of results (false, default).

Réponse

Client grants successfully retrieved.

id
string

ID of the client grant.

client_id
string

ID of the client.

audience
string

The audience (API identifier) of this client grant

Minimum string length: 1
scope
string[]

Scopes allowed for this client grant.

Minimum string length: 1
organization_usage
enum<string>

Defines whether organizations can be used with client credentials exchanges for this grant.

Options disponibles:
deny,
allow,
require
allow_any_organization
boolean

If enabled, any organization can be used with this grant. If disabled (default), the grant must be explicitly assigned to the desired organizations.