Skip to content
HaneDOCS日本語

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.

POST /v1/auth/token
POST /v1/auth/handoff
POST /v1/auth/handoff/redeem
GET /v1/auth/me

POST/v1/auth/token

ログインのセッションか IdP の id_token を、組織・プロジェクト・環境に束縛したアクセストークンに交換する

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 とは併用できない
  • 200 — TokenResponse: アクセストークン
  • default — Problem: RFC 9457 Problem Details

POST/v1/auth/handoff

ログインの画面が、利用者がログインした後に、セッションの cookie を付けて呼ぶ。戻す先は、環境が許した origin の URL だけ。コードは 1 分で切れる

application/json

Name Type Required Description
return_to string yes ログインの後に利用者を戻す、顧客アプリの URL
state string アプリが渡した値。そのまま戻す URL に付ける
  • 200 — object: 戻す先
  • default — Problem: RFC 9457 Problem Details

POST/v1/auth/handoff/redeem

引き換えたセッショントークンは、POST /v1/auth/token の subject_token に、アプリの API キー(actor_token)と一緒に渡す。コードは一度しか引き換えられない

application/json

Name Type Required Description
code string yes
  • 200 — object: セッショントークン
  • default — Problem: RFC 9457 Problem Details

GET/v1/auth/me

自分と、所属する組織(確かめたメールアドレスで招待されている組織も含む)。Bearer がなければ、ログインのセッションの cookie で決める

  • 200 — object: 自分
  • default — Problem: RFC 9457 Problem Details