Grant(認可付与)は、ユーザーがクライアントに対して与えた認可を表します。 ユーザーが特定のクライアントにアクセスを許可すると、Grantレコードが作成されます。
Grantが作成されるタイミング
- Authorization Code Flow での同意時
- Password Grant でのトークン発行時
- その他のGrant Type でのトークン発行時
スコープのマージ
同じユーザー・クライアントの組み合わせで複数回トークンを発行すると、 スコープは累積的にマージされます。
Grant取り消し時の動作
Grantを取り消すと、そのユーザー・クライアントに関連する全てのトークン (アクセストークン、リフレッシュトークン)も同時に削除されます。 これはAuth0と同様の動作です。
Grant一覧取得
組織内の特定のテナントに存在するGrant(認可付与)の一覧を取得します。
クエリパラメータを使用して、特定のユーザーやクライアントでフィルタリングできます。
Authorizations:
bearerAuth
path Parameters
| organization-id required | string <uuid> Example: 72cf4a12-8da3-40fb-8ae4-a77e3cda95e2 組織ID |
| tenant-id required | string <uuid> Example: 952f6906-3e95-4ed3-86b2-981f90f785f9 テナントID |
query Parameters
| limit | integer [ 1 .. 1000 ] Default: 20 Example: limit=20 返却する最大件数(デフォルト: 20、最大: 1000) |
| offset | integer >= 0 Default: 0 スキップする件数(ページネーション用) |
| user_id | string <uuid> Example: user_id=8d8822f0-cf68-455a-aa82-3ccfbc07b060 ユーザーIDでフィルタリング |
| client_id | string Example: client_id=my-client-app クライアントIDでフィルタリング |
| from | string <date-time> Example: from=2025-01-01T00:00:00Z 作成日時の開始範囲(ISO 8601形式) |
| to | string <date-time> Example: to=2025-12-31T23:59:59Z 作成日時の終了範囲(ISO 8601形式) |
Responses
Response samples
- 200
- 401
- 403
- 404
Content type
application/json
{- "list": [
- {
- "id": "6afc99ca-d50a-4a4f-b32b-a93026cda6dc",
- "user": {
- "sub": "8d8822f0-cf68-455a-aa82-3ccfbc07b060",
- "name": "Taro Yamada",
- "email": "taro@example.com"
}, - "client": {
- "client_id": "my-client-app",
- "client_name": "My Application"
}, - "scopes": [
- "openid",
- "profile",
- "email"
], - "created_at": "2025-01-15T10:30:00Z",
- "updated_at": "2025-01-20T14:00:00Z"
}
], - "total_count": 1,
- "limit": 20,
- "offset": 0
}Grant詳細取得
指定されたGrant(認可付与)の詳細情報を取得します
Authorizations:
bearerAuth
path Parameters
| organization-id required | string <uuid> Example: 72cf4a12-8da3-40fb-8ae4-a77e3cda95e2 組織ID |
| tenant-id required | string <uuid> Example: 952f6906-3e95-4ed3-86b2-981f90f785f9 テナントID |
| grant-id required | string <uuid> Example: 6afc99ca-d50a-4a4f-b32b-a93026cda6dc Grant ID |
Responses
Response samples
- 200
- 401
- 403
- 404
Content type
application/json
{- "id": "6afc99ca-d50a-4a4f-b32b-a93026cda6dc",
- "user": {
- "sub": "8d8822f0-cf68-455a-aa82-3ccfbc07b060",
- "name": "Taro Yamada",
- "email": "taro@example.com"
}, - "client": {
- "client_id": "my-client-app",
- "client_name": "My Application"
}, - "scopes": [
- "openid",
- "profile",
- "email"
], - "created_at": "2025-01-15T10:30:00Z",
- "updated_at": "2025-01-20T14:00:00Z"
}Grant取り消し(Revocation)
指定されたGrant(認可付与)を取り消します。
重要: Grantを取り消すと、そのユーザー・クライアントに関連する 全てのトークン(アクセストークン、リフレッシュトークン)も 同時に削除されます。
dry_runモード
dry_run=true を指定すると、実際の削除は行 わずに
削除対象の情報を返します。本番実行前の確認に使用してください。
Authorizations:
bearerAuth
path Parameters
| organization-id required | string <uuid> Example: 72cf4a12-8da3-40fb-8ae4-a77e3cda95e2 組織ID |
| tenant-id required | string <uuid> Example: 952f6906-3e95-4ed3-86b2-981f90f785f9 テナントID |
| grant-id required | string <uuid> Example: 6afc99ca-d50a-4a4f-b32b-a93026cda6dc Grant ID |
query Parameters
| dry_run | boolean Default: false trueの場合、実際の削除は行わずシミュレーション結果を返します |
Responses
Response samples
- 200
- 401
- 403
- 404
Content type
application/json
{- "dry_run": true,
- "grant_id": "6afc99ca-d50a-4a4f-b32b-a93026cda6dc",
- "message": "Revocation simulated successfully"
}