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

# MFAにCisco Duo Securityを構成する

> MFAにCisco Duo Securityを構成する方法について説明します。

export const AuthCodeBlock = ({filename, icon, language, highlight, children}) => {
  const [processedChildren, setProcessedChildren] = useState(children);
  useEffect(() => {
    let unsubscribe = null;
    function init() {
      unsubscribe = window.autorun(() => {
        let processedChildren = children;
        for (const [key, value] of window.rootStore.variableStore.values.entries()) {
          processedChildren = processedChildren.replace(new RegExp(key, "g"), value);
        }
        setProcessedChildren(processedChildren);
      });
    }
    if (window.rootStore) {
      init();
    } else {
      window.addEventListener("adu:storeReady", init);
    }
    return () => {
      window.removeEventListener("adu:storeReady", init);
      unsubscribe?.();
    };
  }, [children]);
  return <CodeBlock filename={filename} icon={icon} language={language} lines highlight={highlight}>
      {processedChildren}
    </CodeBlock>;
};

<Card title="Before you start">
  * お手持ちのDuoアカウントを構成します。詳細については、[Duo Docsの「Getting Started」](https://duo.com/docs/getting-started#getting-started)をお読みください。
  * [Duo SecurityのWeb SDK統合](https://duo.com/docs/duoweb)を作成し、**統合キー** 、**秘密鍵** と**APIホスト名** の資格情報を記録します。
</Card>

Cisco Duoは多角的な認証プロバイダーで、他の要素がすべて無効な場合にのみ、Auth0テナントで使用できます。Duoアカウントはプッシュ通知、SMS、OTP、電話でのコールバックの他、構成によってはそれ以外にも対応することができます。

他の要素が有効になっている場合、Duoは有効化できません。Duoは、それだけが単独で有効になっている場合にのみ使うことができます。

アプリケーションは、ユーザーにDuoを使った第二要素を求める際に、Duoアカウントで有効になっているオプションを表示します。

ユーザーは[Google Play](https://play.google.com/store/apps/details?id=com.duosecurity.duomobile)や[App Store](https://itunes.apple.com/us/app/duo-mobile/id422663827?mt=8)からDuoをダウンロードして、第二要素として使うことができます。

<div id="configure-duo">
  ## Duoを構成する
</div>

Duo Securityを構成するには、<Tooltip data-tooltip-id="react-containers-DefinitionTooltip-0" href="/docs/ja-JP/ja-jp/glossary?term=auth0-dashboard" tip="Auth0 Dashboard: サービスを構成するためのAuth0の主製品。" cta="用語集の表示">Auth0 Dashboard</Tooltip>でアプリケーションにDuoの資格情報を渡す必要があります。

1. [［Dashboard］>［Security（セキュリティ）］>［Multi-factor Auth（多要素認証）］>［Duo Security］](https://manage.auth0.com/#/security/mfa/duo)に移動して、有効にします。
2. フィールドに情報を入力して、DuoアカウントをAuth0とリンクさせます。
3. **［Save（保存）］** を選択します。

<div id="use-actions-to-enable-duo">
  ## アクションを使ってDuoを有効にする
</div>

アクション内でDuoを有効化するには、多要素認証を有効化する際に`duo`を`provider`パラメーターとして渡します。

```javascript lines theme={null}
exports.onExecutePostLogin = async (event, api) => {
  api.multifactor.enable('duo', { allowRememberBrowser: false });
};
```

Duoには、「Remember Me（自動ログイン）」の動作オプションはありません。初回のログイン後にユーザーを記憶しておく、30日間の<Tooltip data-tooltip-id="react-containers-DefinitionTooltip-0" href="/docs/ja-JP/ja-jp/glossary?term=multifactor-authentication" tip="多要素認証（MFA）: ユーザー名とパスワードに加えて、SMS経由のコードなどの要素を使用するユーザー認証プロセス。" cta="用語集の表示">MFA</Tooltip>セッションがハードコードされています。

ユーザーが毎回Duoを使ってログインすることを強制するには、`allowRememberBrowser: false`を使ってルールを作成します。

<div id="actions-template-for-duo">
  ## Duo用のアクションテンプレート
</div>

このテンプレートは例として、条件が満たされた場合に[Duo Security](http://duosecurity.com/)を使った多要素認証をトリガーする始点を提供します。

初めてログインした後、ユーザーはデバイスを登録することができます。

<Callout icon="file-lines" color="#0EA5E9" iconType="regular">
  Duo Securityでは、**Web SDK** と**Admin SDK** の2種類の統合を作成する必要があります。
</Callout>

export const codeExample = `exports.onExecutePostLogin = async (event, api) => {

	const CLIENTS_WITH_MFA = ['{yourClientId}'];
	// run only for the specified clients
	if (CLIENTS_WITH_MFA.includes(event.client.client_id)) {

		// uncomment the following if clause in case you want to request a second factor only from user's that have user_metadata.use_mfa === true
		//if (event.user.user_metadata && event.user.user_metadata.use_mfa){

		// optional, defaults to true. Set to false to force DuoSecurity every time.
		// See https://auth0.com/docs/multifactor-authentication/custom#change-the-frequency-of-authentication-requests for details
		api.multifactor.enable('duo', {
			providerOptions.ikey: configuration.DUO_IKEY,
			providerOptions.skey: configuration.DUO_SKEY,
			providerOptions.host: configuration.DUO_HOST,
			allowRememberBrowser: false
		})

		// optional. Use some attribute of the profile as the username in DuoSecurity. This is also useful if you already have your users enrolled in Duo.
		// username: event.user.nickname
	};
	// }

};`;

<AuthCodeBlock children={codeExample} language="javascript" />

<div id="current-limitations">
  ## 現在の制限
</div>

* Duoを使ってユーザーを登録するのに、[Auth0のMFA登録チケット](/docs/ja-JP/ja-jp/secure/multi-factor-authentication/multi-factor-authentication-developer-resources/create-custom-enrollment-tickets)は使用できません。それらのユーザーは、Duoから登録します。
* ユニバーサルログインを使う場合には、上記のように、アクションで`provider`を`duo`に設定してDuoを有効化する必要があります。特定のアプリケーションには、Duoを条件付きで使用するか、内蔵のAuth0プロバイダーを使うことができます。

<div id="learn-more">
  ## もっと詳しく
</div>

* [多要素認証問題をトラブルシューティングする](/docs/ja-JP/ja-jp/troubleshoot/authentication-issues/troubleshoot-mfa-issues)
