Passer au contenu principal
GET
https://{tenantDomain}/api/v2
/
organizations
/
{id}
/
client-grants
Go
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,
    )
}
[
  {
    "allow_any_organization": true,
    "audience": "<string>",
    "client_id": "<string>",
    "id": "<string>",
    "scope": [
      "<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

Identifiant de l’organisation.

Maximum string length: 50

Paramètres de requête

audience
string

Filtre facultatif sur l’audience de l’autorisation d’application.

Maximum string length: 600
client_id
string

Filtre facultatif sur le client_id de l’autorisation d’application.

grant_ids
string<client-grant-id>[]

Filtre facultatif sur l’ID de l’autorisation d’application. Doit être encodé dans l’URL et peut être indiqué plusieurs fois (max. 10).
p. ex. ../client-grants?grant_ids=id1&grant_ids=id2

page
integer

Indice de page des résultats à renvoyer. La première page est 0.

Plage requise: x >= 0
per_page
integer

Nombre de résultats par page. La valeur par défaut est 50.

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

Renvoyer les résultats dans un objet contenant le nombre total de résultats (true) ou comme tableau direct de résultats (false, par défaut).

Réponse

Autorisations d’application récupérées avec succès.

allow_any_organization
boolean

Si cette option est activée, n’importe quelle organisation peut être utilisée avec cette autorisation. Si elle est désactivée (par défaut), l’autorisation doit être explicitement attribuée aux organisations souhaitées.

audience
string

Audience (identifiant d’API) de cette autorisation d’application

Minimum string length: 1
client_id
string

ID de l’application.

id
string

ID de l’autorisation d’application.

organization_usage
enum<string>

Définit si les organisations peuvent être utilisées avec Client Credentials Exchange pour cet octroi.

Options disponibles:
deny,
allow,
require
scope
string[]

Scopes autorisés pour cette autorisation d’application.

Minimum string length: 1