API reference
Authentication
Token exchange and the caller's identity before entering an organization.
Generated from the public API contract (OpenAPI). Descriptions in the contract are written in Japanese.
Endpoints
Section titled “Endpoints”| POST | /v1/auth/token |
| POST | /v1/auth/handoff |
| POST | /v1/auth/handoff/redeem |
| GET | /v1/auth/me |
exchangeToken
Section titled “exchangeToken”POST/v1/auth/token
ログインのセッションか IdP の id_token を、組織・プロジェクト・環境に束縛したアクセストークンに交換する
Request body
Section titled “Request body”application/json
| Name | Type | Required | Description |
|---|---|---|---|
grant_type |
object | yes | |
subject_token |
string | ログインのセッショントークンか、IdP の id_token。省くと、ログインのセッションの cookie、提供側の経路の Cloudflare Access のトークンの順に使う | |
subject_token_type |
urn:ietf:params:oauth:token-type:id_token | urn:hane:params:token-type:session |
||
actor_token |
string | 顧客アプリのサービスアカウントの API キー。あれば利用者とアプリのスコープの共通部分になる | |
actor_token_type |
object | ||
organization |
string | yes | 組織の name か tenant_id |
project |
string | ||
environment |
Environment | ||
engagement |
string | 運営者の委任の ID。organization は顧客の組織にする。プロジェクトと環境は委任で決まるので project・environment・actor_token とは併用できない |
Responses
Section titled “Responses”- 200 —
TokenResponse: アクセストークン - default —
Problem: RFC 9457 Problem Details
handOffLogin
Section titled “handOffLogin”POST/v1/auth/handoff
ログインの画面が、利用者がログインした後に、セッションの cookie を付けて呼ぶ。戻す先は、環境が許した origin の URL だけ。コードは 1 分で切れる
Request body
Section titled “Request body”application/json
| Name | Type | Required | Description |
|---|---|---|---|
return_to |
string | yes | ログインの後に利用者を戻す、顧客アプリの URL |
state |
string | アプリが渡した値。そのまま戻す URL に付ける |
Responses
Section titled “Responses”- 200 —
object: 戻す先 - default —
Problem: RFC 9457 Problem Details
redeemLoginHandoff
Section titled “redeemLoginHandoff”POST/v1/auth/handoff/redeem
引き換えたセッショントークンは、POST /v1/auth/token の subject_token に、アプリの API キー(actor_token)と一緒に渡す。コードは一度しか引き換えられない
Request body
Section titled “Request body”application/json
| Name | Type | Required | Description |
|---|---|---|---|
code |
string | yes |
Responses
Section titled “Responses”- 200 —
object: セッショントークン - default —
Problem: RFC 9457 Problem Details
GET/v1/auth/me
自分と、所属する組織(確かめたメールアドレスで招待されている組織も含む)。Bearer がなければ、ログインのセッションの cookie で決める
Responses
Section titled “Responses”- 200 —
object: 自分 - default —
Problem: RFC 9457 Problem Details