メインコンテンツへスキップ
POST
https://{tenantDomain}/api/v2
/
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"
)

func do() {
    client := client.NewClient(
        option.WithToken(
            "<token>",
        ),
    )
    request := &management.CreateClientGrantRequestContent{
        ClientId: "client_id",
        Audience: "audience",
        Scope: []string{
            "scope",
        },
    }
    client.ClientGrants.Create(
        context.TODO(),
        request,
    )
}
{
  "allow_all_scopes": true,
  "allow_any_organization": true,
  "audience": "<string>",
  "authorization_details_types": [
    "<string>"
  ],
  "client_id": "<string>",
  "id": "<string>",
  "is_system": true,
  "scope": [
    "<string>"
  ]
}

承認

Authorization
string
header
必須

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

ボディ

audience
string
必須

このクライアントグラントのオーディエンス(API 識別子)

Minimum string length: 1
allow_all_scopes
boolean

有効な場合、リソースサーバーで設定されているすべてのスコープがこのグラントで許可されます。

allow_any_organization
boolean
デフォルト:false

有効な場合、このグラントは任意の組織で使用できます。無効な場合(デフォルト)、対象の組織にこのグラントを明示的に割り当てる必要があります。

authorization_details_types
string[]

このクライアントグラントで許可される authorization_details のタイプ。

Required string length: 1 - 255
client_id
string

クライアントの ID。

default_for
enum<string>
GA

このクライアントグラントを、指定したグループ内のすべてのクライアントのデフォルトとして適用します。指定できる値は third_party_clients のみで、これによりすべての third-party クライアントにグラントが適用されます。同じオーディエンスに対するクライアント単位のグラントが優先されます。client_id とは同時に使用できません。

利用可能なオプション:
third_party_clients
organization_usage
enum<string>

このグラントで、クライアントクレデンシャル交換に組織を使用できるかどうかを定義します。

利用可能なオプション:
deny,
allow,
require
scope
string[]

このクライアントグラントで許可されるスコープ。

Required string length: 1 - 280
subject_type
enum<string>

このクライアントグラントで許可されるアプリケーションアクセスの種類。

利用可能なオプション:
client,
user

レスポンス

クライアントグラントを正常に作成しました。

allow_all_scopes
boolean

有効な場合、リソースサーバーで設定されているすべてのスコープがこのグラントで許可されます。

allow_any_organization
boolean

有効な場合、このグラントは任意の組織で使用できます。無効な場合(デフォルト)、対象の組織にこのグラントを明示的に割り当てる必要があります。

audience
string

このクライアントグラントのオーディエンス(API 識別子)。

Minimum string length: 1
authorization_details_types
string[]

このクライアントグラントで許可される authorization_details のタイプ。

Required string length: 1 - 255
client_id
string

クライアントの ID。

default_for
enum<string>
GA

このクライアントグラントを、指定したグループ内のすべてのクライアントのデフォルトとして適用します。指定できる値は third_party_clients のみで、これによりすべての third-party クライアントにグラントが適用されます。同じオーディエンスに対するクライアント単位のグラントが優先されます。client_id とは同時に使用できません。

利用可能なオプション:
third_party_clients
id
string

クライアントグラントの ID。

is_system
boolean

有効な場合、このグラントは Auth0 によって作成された特別なグラントです。直接変更または削除することはできません。

organization_usage
enum<string>

このグラントで、クライアントクレデンシャル交換に組織を使用できるかどうかを定義します。

利用可能なオプション:
deny,
allow,
require
scope
string[]

このクライアントグラントで許可されるスコープ。

Minimum string length: 1
subject_type
enum<string>

このクライアントグラントで許可されるアプリケーションアクセスの種類。

利用可能なオプション:
client,
user