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

# ネイティブアプリケーションでの埋め込みPasswordlessログイン

> ネイティブアプリケーションで埋め込みログインを使用してPasswordless認証を実装する方法について説明します。

Native アプリケーションで埋め込みの Passwordless (Passwordless: パスワードを第一要素として用いない認証方式。) API を使用するには、アプリケーションの **Advanced Settings** > **Grant Types** にある設定で、[Auth0 Dashboard > Applications > Applications](https://manage.auth0.com/#/applications) にて **Passwordless OTP** grant を有効にしてください。

Native アプリケーション向けの Passwordless 認証は、次の 2 つの手順で構成されます。

* アプリケーションでユーザー識別子 (ユーザーのメールアドレスまたは電話番号) を取得し、`/passwordless/start` エンドポイントを呼び出して Passwordless フローを開始します。ユーザーにはワンタイムパスワードがメールまたは SMS で送信されます。
* ユーザーにワンタイムコードの入力を求め、`/oauth/token` エンドポイントを呼び出して認証トークンを取得します。

以下に、さまざまなシナリオでこれらの API エンドポイントを呼び出すために使用できるコードスニペットをいくつか示します。

**メールでワンタイムパスワードを送信する**

**メールでマジックリンクを送信**

**SMSでワンタイムパスワードを送信する**

**SMSユーザーの認証**

**メールユーザーを認証する**

必要に応じて、Android または iOS の SDK を使用することもできます。これらの SDK は、この API を各プラットフォームに適した形で扱いやすくラップしています。

* [Lock.Android Passwordless](/docs/docs/ja-jp/libraries/lock-android/lock-android-passwordless)
* [Auth0.Android Passwordless](/docs/docs/ja-jp/libraries/auth0-android/auth0-android-passwordless)
* [Auth0.swift Passwordless](/docs/docs/ja-jp/libraries/auth0-swift/auth0-swift-passwordless)

## 埋め込み で MFA をカスタマイズする

> [!WARNING]
>
> **Resource Owner Password Grant、埋め込み、または Refresh Token フローでカスタマイズ可能な MFA機能は現在、[早期アクセス](/docs/docs/troubleshoot/product-lifecycle/product-release-stages)です。**
>
> この機能を使用することにより、Oktaの該当する無料トライアル規約および[Master Subscription Agreement](https://www.okta.com/legal)に同意したものとみなされます。

埋め込み フローで MFA (多要素認証 (MFA): SMS で送信されるコードなど、ユーザー名とパスワードに加えて別の要素を使用するユーザー認証プロセス。) をカスタマイズできます。MFA API を使用すると、ユーザーはアプリケーションでサポートされている任意の要素を選んで登録やチャレンジを行えます。

アプリケーションが `oauth/token` エンドポイントで access token (Access Token: API へのアクセスに使用される、不透明な文字列または JWT 形式の Authorization 資格情報。) をリクエストすると、返されるレスポンスには、MFA API の使用に必要な `mfa_token` と、アプリケーションが現在サポートしている認証器の一覧を含む `mfa_requirements` パラメーターが含まれます：

```json lines theme={null}
{
  "error": "mfa_required",
  "error_description": "Multifactor authentication required",
  "mfa_token": "Fe26...Ha",
  "mfa_requirements": {
    "challenge": [
      { "type": "otp" },
      { "type": "push-notification" },
      { "type": "phone" },
      { "type": "recovery-code" }
    ]
  }
}
```

`mfa_token` を使用して [`mfa/authenticator`](/docs/docs/ja-jp/api/authentication/multi-factor-authentication/list-authenticators) エンドポイントを呼び出し、ユーザーが登録しているすべての要素を一覧表示して、アプリケーションがサポートしているものと同じ `type` を持つものを特定します。チャレンジを発行するには、対応する `authenticator_type` も取得する必要があります:

```json lines theme={null}
[
  {
    "type": "recovery-code",
    "id": "recovery-code|dev_qpOkGUOxBpw6R16t",
    "authenticator_type": "recovery-code",
    "active": true
  },
  {
    "type": "otp",
    "id": "totp|dev_6NWz8awwC8brh2dN",
    "authenticator_type": "otp",
    "active": true
  }
]
```

[`request/mfa/challenge`](/docs/docs/ja-jp/api/authentication/multi-factor-authentication/request-mfa-challenge) エンドポイントを呼び出して、MFAチャレンジを適用します。

Auth0 Actions を使うと、MFAフローをさらにカスタマイズできます。詳しくは、[Actions Triggers: post-challenge - API Object](/docs/docs/ja-jp/actions/reference/password-reset-post-challenge/password-reset-post-challenge-api-object) をご覧ください。
