API Endpoints リファレンス
AuthSafe OAuth 2.0およびOpenID Connectエンドポイントに関する完全なリファレンス。
ベースURL
このページにあるすべてのエンドポイントは、以下のものに対する相対値です。
https://identities.authsafe.in認証エンドポイント: GET /auth/authorize
ユーザーサインインフローを開始し、リダイレクトURIに認証コードを返します。
クエリパラメータ
| パラメータ | タイプ | 必須 | 説明 |
|---|---|---|---|
client_id | string | Yes | Your application client identifier |
redirect_uri | string | Yes | Where AuthSafe redirects after sign-in |
response_type | string | Yes | Use code for authorization code flow |
scope | string | No | Space-separated scopes, for example openid profile email |
state | string | Recommended | Opaque value to bind request and callback |
code_challenge | string | Yes | PKCE challenge value |
code_challenge_method | string | Yes | Must be S256 |
リクエスト例
curl "https://identities.authsafe.in/auth/authorize?client_id=your_client_id&redirect_uri=https://yourapp.com/callback&response_type=code&scope=openid%20profile%20email&state=random_state&code_challenge=CODE_CHALLENGE&code_challenge_method=S256"応答
https://yourapp.com/callback?code=AUTHORIZATION_CODE&state=random_stateトークンエンドポイント: POST /auth/token
認証コードの交換、トークンの更新、またはクライアント認証情報アクセストークンの発行を行います。
リクエストボディパラメータ
| パラメータ | タイプ | 必須 | 説明 |
|---|---|---|---|
grant_type | string | Yes | authorization_code | refresh_token | client_credentials |
code | string | Conditional | Authorization code for authorization_code grant |
refresh_token | string | Conditional | Refresh token for refresh_token grant |
client_id | string | Yes | Your application client identifier |
client_secret | string | Yes | Client secret for confidential clients |
code_verifier | string | Conditional | PKCE verifier for authorization_code grant |
リクエスト例
curl -X POST https://identities.authsafe.in/auth/token \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=authorization_code" \
-d "code=AUTHORIZATION_CODE" \
-d "redirect_uri=https://yourapp.com/callback" \
-d "client_id=your_client_id" \
-d "client_secret=your_client_secret" \
-d "code_verifier=CODE_VERIFIER"応答
{
"access_token": "eyJ...",
"token_type": "Bearer",
"expires_in": 3600,
"refresh_token": "...",
"id_token": "eyJ...",
"scope": "openid profile email"
}追加エンドポイント
GET /auth/user-info
有効なアクセストークンを指定して呼び出すと、認証済みユーザーのクレームを返します。
POST /auth/introspect
RFC 7662 に従ってトークンの状態とメタデータを検証します。
POST /auth/revoke
RFC 7009 に従って、アクセス トークンまたはリフレッシュ トークンを取り消します。
GET /auth/logout
ユーザーセッションを終了し、必要に応じてログアウト後のURIにリダイレクトします。
GET /auth/branding
特定のクライアントのパブリックブランディング設定を返します。
/.well-known/*
OIDC検出メタデータとJWKS公開鍵を提供します。
エラー応答
AuthSafeは、標準的なOAuth 2.0エラー構造を返します。
{
"error": "invalid_request",
"error_description": "Missing required parameter: code_verifier"
}| エラーコード | 説明 |
|---|---|
invalid_request | Request is malformed or missing a required parameter |
invalid_client | Client authentication failed |
invalid_grant | Authorization code or refresh token is invalid or expired |
unauthorized_client | Client is not allowed to use the requested grant |
unsupported_grant_type | Grant type is not supported |
invalid_scope | Requested scope is unknown or not allowed |
access_denied | Resource owner or authorization server denied the request |
セキュリティに関する考慮事項
PKCEは必須です
認証コードフローには、有効なコードチャレンジとコード検証者のペアを含める必要があります。
トークン署名検証
/.well-known/jwks.json のキーを使用して JWT 署名を検証します。
安全なトークン保管
トークンをURLやログに公開しないでください。トークンは、安全なクライアントおよびサーバーパターンを使用して保存してください。
トークンの有効期間
アクセストークンは有効期限が短いため、セッションを継続するにはリフレッシュトークンを使用してください。
律速段階
レスポンスには、クライアントが安全にトラフィックを制限して再試行できるようにするためのレート制限ヘッダーが含まれます。
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1234567890制限を超えた場合、AuthSafeはHTTP 429 Too Many Requestsを返します。