> ## Documentation Index
> Fetch the complete documentation index at: https://auth0-docs-event-stream-action-templates.mintlify.site/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`は必須のCallback URLで、アプリケーションの\*\*［許可されているCallback URL］\*\*に登録されていなければなりません。

### 詳しい情報

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

## Parameters

<ParamField body="grant_type" type="string">
  [http://auth0.com/oauth/grant-type/passwordless/otpにする必要があります。](http://auth0.com/oauth/grant-type/passwordless/otp%E3%81%AB%E3%81%99%E3%82%8B%E5%BF%85%E8%A6%81%E3%81%8C%E3%81%82%E3%82%8A%E3%81%BE%E3%81%99%E3%80%82)
</ParamField>

<ParamField body="client_id" type="string">
  アプリケーションのclient\_idです。
</ParamField>

<ParamField body="client_secret" type="string">
  アプリケーションのclient\_secretです。通常のWebアプリケーションのみに必須です。
</ParamField>

<ParamField body="otp" type="string">
  ユーザーの確認コードです。
</ParamField>

<ParamField body="realm" type="string">
  使用される接続と一致する必要があります。
</ParamField>

<ParamField body="username" type="string">
  ユーザーの電話番号かメールアドレスです。
</ParamField>

<ParamField body="audience" type="string">
  アクセストークンを取得したいAPIのAPI識別子です。
</ParamField>

<ParamField body="scope" type="string">
  IDトークンを取得するためにopenidを使用します。
</ParamField>

<ParamField body="redirect_uri" type="string">
  アプリケーションの許可されているCallback URLで登録されたCallback URLです。
</ParamField>

## Response

| Status | Description          |
| ------ | -------------------- |
| 200    | ユーザーが正常に認証されました。     |
| 400    | 不正な要求です。無効なパラメーターです。 |
| 401    | 認可されていません。無効な資格情報です。 |
