比較バージョン

キー

  • この行は追加されました。
  • この行は削除されました。
  • 書式設定が変更されました。
警告

Shibboleth IdP 4.1以降では本体にTOTPプラグインがモジュールとして提供されておりますので、そちらの使用をお勧めします。本ページは本来4.0.x向けのものであり、4.1にて動作するように設定手順を修正したものです。

1. はじめに

Shibboleth IdPでの認証において、Google Authenticatorなど、TOTPに対応したデバイス/アプリのワンタイムパスワードを追加で必要とするように変更します。

...

注意

本IdPプラグインの添付されたバージョンでは登録できるデバイスの数を1個のみに制限し二要素認証としての効力を確保するものとなります。登録手続きにはIPアドレス等による制限はかかりません。

このままでの運用に不都合がある場合は、登録手続きにアクセス制限をかけた上で個数制限を緩和することをご検討ください。


注意

本TotpフローをExtendedフローの中で使用しようとしてもうまくいきません(Totpを選択してもID・パスワード欄が表示されません)。認証フローを組み合わせたい場合はMFAフローをご検討ください。

...

conf/, edit-webapp/, flows/, views/ の内容をディレクトリ構造を保持したまま/opt/shibboleth-idp/以下に配置。

idpconf/authn/authn.propertiesのidp.authn.flowsに "| Totp "を追加。を指定。

コード ブロック
languagediff
-idp.authn.flows = Password
+idp.authn.flows = Password|Totp


conf/authn/general-authn.xmlの <util:list id="shibboleth.AvailableAuthenticationFlows"> の子要素として以下を挿入します。TOTPの優先順位を高くするためには先頭に挿入してください。global.xmlの末尾(</beans>の上)に以下を挿入します。

コード ブロック
languagexml
        <bean id="authn/Totp" parent="shibboleth.AuthenticationFlow"
                p:passiveAuthenticationSupported="true"
                p:forcedAuthenticationSupported="true">
            <property name="supportedPrincipals">
                <util:list>
                    <bean parent="shibboleth.SAML2AuthnContextClassRef"
                        c:classRef="urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken" />
<!--
                </util:list>
    <bean parent="shibboleth.SAML2AuthnContextClassRef"
       </property>
        </bean>

conf/authn/password-authn-config.xmlにパスワードを持ち回る必要があるため以下の行を追加します。

コード ブロック
@@ -23,6 +23,8 @@
     <bean idc:classRef="shibboleth.authn.Password.PasswordFieldName" class="java.lang.String" c:_0="j_passwordurn:mace:gakunin.jp:idprivacy:ac:classes:Level2" />
                    <bean idparent="shibboleth.authn.Password.SSOBypassFieldName" class="java.lang.String" c:_0="donotcache" />
 
+    <util:constant id="shibboleth.authn.Password.RemoveAfterValidation" static-field="java.lang.Boolean.FALSE"/>
+
     <!-- Simple transforms to apply to username before validation. -->
     <util:constant id="shibboleth.authn.Password.Lowercase" static-field="java.lang.Boolean.FALSE"/>
     <util:constant id="shibboleth.authn.Password.Uppercase" static-field="java.lang.Boolean.FALSE"/>

...

SAML2AuthnContextClassRef"
                        c:classRef="urn:mace:gakunin.jp:idprivacy:ac:classes:Level1" />
-->
                </util:list>
            </property>
        </bean>

※ 他の活用編メニューにてLevel1/Level2の認証強度の設定を実施済みの場合は、コメントアウトを解除してTOTPをLevel2相当としてください。


conf/authn/authn.propertiesにパスワードを持ち回る必要があるため以下の行を修正します。

コード ブロック
@@ -42,7 +42,7 @@
 # Override this and removeAfterValidation to require all validators to succeed
 #idp.authn.Password.requireAll = false
 # Override to keep the password around
-#idp.authn.Password.removeAfterValidation = true
+idp.authn.Password.removeAfterValidation = false
 # Override to store password in Java Subject
 #idp.authn.Password.retainAsPrivateCredential = false
 # Simple username transforms before validation


/opt/shibboleth-idp/bin/build.shを実行し、WARファイル再作成およびデプロイします。
最後にJettyの再起動を行います。

パネル
borderColor#cccccc
bgColor#eeeeee
borderStylesolid

# /opt/shibboleth-idp/bin/build.sh
Buildfile: /opt/shibboleth-idp/bin/build.

...

xml
build-war:
Installation Directory: [/opt/shibboleth-idp] ?
[Enter] ←入力なし

# systemctl restart jetty



...

3. 手順書

以下は、利用するTOTPプラグインの開発元のURLです。詳細にご興味がある方はご参照ください。
Shibboleth IdPバージョン3.2対応のものであるため、4以降で実行するためには上記のパッケージおよび手順が必要となります。

...

  1. 上記登録直後はワンタイムパスワード入力画面になりますが、入力せずに、再度接続確認用SPから各自が使用するIdPを選択します。
  2. 第一画面は通常と変わりませんので、通常のUsername/Passwordを入力して次に進みます。
  3. "Token code"というワンタイムパスワードを入力する画面になりますので、TOTP対応アプリ/デバイスに表示されている数字6桁のワンタイムパスワードを入力して次に進みます。
  4. 通常通り送信属性同意画面および属性受信の確認ページが表示されます。
  5. ページ下部の「セッション情報」をクリックして、以下のように認証手段がパスワード認証時と異なることを確認してください。

    パネル

    Authentication Context Class: urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken

    (もしくは他の活用編メニューを実施していればLevel1ないしLevel2)