> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# ユーザーを認証

> 電話番号またはメールアドレスと、パスワードレス確認コードを使用してユーザーを認証します。

## エンドポイント

`POST /oauth/token`

確認コードを取得したら、このエンドポイントを使用して、電話番号またはメールアドレスと確認コードでユーザーをログインさせます。

### 注意事項

* `grant_type` には `http://auth0.com/oauth/grant-type/passwordless/otp` を指定する必要があります。
* アプリケーションの `client_id` が必要です。
* `username` には、ユーザーの電話番号 (`realm=sms` の場合) またはメールアドレス (`realm=email` の場合) を指定します。
* `realm` には `sms` または `email` のいずれかを指定し、[POST /passwordless/start](#get-code-or-link) リクエストと一致させる必要があります。
* `otp` にはユーザーの確認コードを指定します。
* `redirect_uri` は必須のコールバック URL で、アプリケーションの **Allowed Callback URLs** に登録されている必要があります。

### 詳細はこちら

* [パスワードレス認証](https://auth0.com/docs/authenticate/passwordless)

## ヘッダー

**DPoP** `string`

リクエストの DPoP 証明です。これは任意で、アプリケーションで Demonstrating Proof-of-Possession を使用する場合にのみ必要です。

## ボディパラメーター

リクエストボディは `application/x-www-form-urlencoded` 形式です。

**grant\_type** `string` *required*

指定する値は `http://auth0.com/oauth/grant-type/passwordless/otp` である必要があります。

**client\_id** `string` *required*

アプリケーションの client\_id。

**client\_secret** `string`

アプリケーションの client\_secret。Regular Web Applications の場合にのみ必須です。

**otp** `string` *required*

ユーザーの確認コード。

**realm** `string` *required*

使用するコネクションと一致している必要があります。

使用可能な値: `email`, `sms`

**username** `string` *required*

ユーザーの電話番号またはメールアドレス。

**audience** `string`

アクセストークンを取得する対象 API の API Identifier。

**resource** `string`

アクセスする対象 API (リソースサーバー) の識別子。Auth0 テナントに登録されている API Identifier と一致している必要があります。テナントの [Resource Parameter Compatibility Profile](https://auth0.com/docs/get-started/tenant-settings#settings-advanced) が `compatibility` に設定されている場合は、`audience` の代わりに使用されます。

**scope** `string`

ID トークンを取得するには `openid` を使用します。

**redirect\_uri** `string` *required*

アプリケーションの Allowed Callback URLs に登録されているコールバック URL。

## レスポンスメッセージ

| ステータス | 説明 |
| - | - |
| 200 | ユーザー認証に成功しました。 |
| 400 | 不正なリクエストです。パラメータが無効です。 |
| 401 | 認証されていません。認証情報が無効です。 |
