1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Auth0 の Rules で LINE WORKS で多要素認証を利用する

Last updated at Posted at 2019-04-21

Auth0 の Rules を用いて、LINE WOKRS で多要素認証を利用可能にします。
なお、事前に Auth0 を LINE WORKS の認証基盤とするよう設定が必要です。以下の記事を参照。
TITLE: Auth0 で LINE WORKS に SSO
URL: https://qiita.com/iwaohig/items/af93af5ac1e1f420ea01

Auth0 の Multifactor Auth の設定

1.Auth0 の管理画面にアクセス
2.[Multifactor Auth] メニューをクリック
3.[Factors] で利用する認証要素を選択
今回は Google Authenticator を使う想定で [One-time Password] のトグルを ON

Auth0 の Rules の設定

Auth0 の管理画面内に多数の rule template が用意されており、要件に見合ったものを利用することができます。

1.Auth0 の管理画面にアクセス
2.[Rules] メニューをクリック
3.[+ Create RULE] ボタンをクリック
4.[Pick a rule tempate] の [Multifactor] カテゴリーから要件に応じたテンプレートを選択
5.ここでは "Multifactor when request comes from outside an IP range" を選択し、社内ネットワーク以外からのアクセス時は MFA といった想定で設定
6. [Edit Rule] でテンプレートが表示される
要件に沿った編集をここで行う

function (user, context, callback) {
  const ipaddr = require('ipaddr.js');
  const corp_network = "192.168.1.134/26";
  const current_ip = ipaddr.parse(context.request.ip);

  if (!current_ip.match(ipaddr.parseCIDR(corp_network))) {
    context.multifactor = {
      provider: 'guardian',

      // optional, defaults to true. Set to false to force Guardian authentication every time.
      // See https://auth0.com/docs/multifactor-authentication/custom#change-the-frequency-of-authentication-requests for details
      allowRememberBrowser: false
    };
  }

  callback(null, user, context);
}

7.[SAVE] をクリック

以上の設定により、指定されたネットワーク以外からのログイン試行時には、多要素認証を利用可能となります。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?