Excerpt | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Shibboleth IdP 3以降の高度な認証設定についてのドキュメントです。4.1以降で書式が大幅に変更になりましたのでそれに特化した記述になっております。本ドキュメントはSAML 2.0で認証の切り替えを行うことを目的としており、SAML1は対象外です(LevelXを用いた認証要求はできません)。
本ドキュメントで使用する認証コンテクストと認証フローの関係を下記に示します。
この認証コンテクストとは別に、PasswordやX509は固有の認証コンテクストを持っていますが、ここでは使用しません。 挙動の説明で使用するSPについて下記に示します。
認証フローの階層化設定
挙動未認証の場合
|
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
saml2/urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport, \ saml2/urn:oasis:names:tc:SAML:2.0:ac:classes:Password, \ saml1/urn:oasis:names:tc:SAML:1.0:am:password, \ - saml2/urn:mace:gakunin.jp:idprivacy:ac:classes:Level1 + saml2/urn:mace:gakunin.jp:idprivacy:ac:classes:Level1, \ + saml2/urn:mace:gakunin.jp:idprivacy:ac:classes:Level2, \ + saml2/urn:mace:gakunin.jp:idprivacy:ac:classes:Level3 # Validators are controlled in password-authn-config.xml |
conf/authn/password-authn-config.xml
でExtendedフローのbean
をアンコメントし、下記の設定を行います。もし当該ファイルにこの部分が存在しなければ、最終行の1つ上にこの部分を挿入してください。
shibboleth.authn.Password.ExtendedFlows
のc:_0に、ExtendedフローとするRemoteUser
とX509
を設定します。shibboleth.authn.Password.PrincipalOverride
に、Password認証フローで認証するLevel1
を追加します。Level2
やLevel3
を除いているところがポイントです。
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<!-- Configuration of "extended" login methods to offer in the password login form. The String bean is a regular expression identifying the flows to offer. These flows must also be enabled at the "top" level to be available for use. The ExtendedFlowParameters bean can be used to transfer custom parameters from the login form into the context tree for use later by other flows. The last bean provides the set of custom Principals to use for results produced by the Password flow itself. You would use this if you need the Password flow to run as a shell to run the "extended" login methods, but want to limit its own results more narrowly. --> - <!-- - <bean id="shibboleth.authn.Password.ExtendedFlows" class="java.lang.String" c:_0="" /> + <bean id="shibboleth.authn.Password.ExtendedFlows" class="java.lang.String" c:_0="RemoteUser|X509" /> <util:list id="shibboleth.authn.Password.ExtendedFlowParameters"> </util:list> <util:list id="shibboleth.authn.Password.PrincipalOverride"> <bean parent="shibboleth.SAML2AuthnContextClassRef" c:classRef="urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport" /> <bean parent="shibboleth.SAML2AuthnContextClassRef" c:classRef="urn:oasis:names:tc:SAML:2.0:ac:classes:Password" /> <bean parent="shibboleth.SAML1AuthenticationMethod" c:method="urn:oasis:names:tc:SAML:1.0:am:password" /> + <!-- --> + <bean parent="shibboleth.SAML2AuthnContextClassRef" + c:classRef="urn:mace:gakunin.jp:idprivacy:ac:classes:Level1" /> </util:list> - --> |
Shibboleth IdP 4.1および4.2にはバグがありますので手動でaddDefaultPrincipalsをfalseにしてください。
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
# Unset if using customized Principals per validator -#idp.authn.Password.addDefaultPrincipals = true +idp.authn.Password.addDefaultPrincipals = false # The Principal collection below is the typical default if not otherwise noted. |
Shibboleth IdP 4.0.0および4.0.1をお使いの場合および以降のバージョンでも以前のバージョンからアップデートしている場合は、login.vmにバグがあり追加のボタンが表示されませんので、以下の修正を行ってください。
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
#end #foreach ($extFlow in $extendedAuthenticationFlows) - #if ($authenticationContext.isAcceptable($extFlow) and $extFlow.apply(profileRequestContext)) + #if ($authenticationContext.isAcceptable($extFlow) and $extFlow.test(profileRequestContext)) <div class="form-element-wrapper"> <button class="form-element form-button" type="submit" name="_eventId_$extFlow.getId()"> #springMessageText("idp.login.$extFlow.getId().replace('authn/','')", $extFlow.getId().replace('authn/','')) |
挙動
各SPからIdPにリダイレクトされた時に表示されるPassword認証フローのログインページを下記に示します。
SPaおよびSPbからの場合
Password認証フローのための「Username」と「Passowrd」のフォームと「Login」ボタン、およびExtendedフローであるRemoteUser認証フローとX509認証フローのためのボタン「RemoteUser」と「X509」が表示されます。Info 「Login」とボタンの形状が同じで紛らわしいですが、Extendedフローを利用する場合は上部のフォーム(「Username」と「Passowrd」)の入力は不要です。
Gallery include ExtendedFlow-level1.png title 図1. SPaおよびSPbからの場合 - SPcからの場合
ExtendedフローであるRemoteUser認証フローとX509認証フローのためのボタン「RemoteUser」と「X509」が表示されます。Level1
のPassword認証フローは表示されません。Gallery include ExtendedFlow-level2.png title 図2. SPcからの場合 - SPdからの場合
ExtendedフローのうちLevel3
以上であるX509認証フローのためのボタン「X509」が表示されます。Level1
のPassword認証フロー、およびLevel2
のX509認証フローは表示されません。Gallery include ExtendedFlow-level3.png title 図3. SPdからの場合
参考
高度な認証フローを設定する上で、参考になるドキュメントを下記に示します。
- [Shibboleth wiki] AuthenticationConfiguration
- [Shibboleth wiki] AuthenticationFlowSelection
- [Shibboleth wiki] PasswordAuthnConfiguration|ExtendedFlows
の"Extended Flows" - [Shibboleth wiki] Orchestrating Multiple Authentication Methods and Contexts - The Multi-Context Broker (MCB)
- [Shibboleth wiki] Configuring the IdP for the Multi-Context Broker Model
- [Shibboleth wiki] Replicating Multi-Context Broker Functionality (Duo + Username/Password with user-opt-in forcing Duo)
- [Shibboleth wiki] SP-driven Duo opt-in
(リンク先にsystem/以下のファイルを編集している箇所がありますが推奨されていません) - 3.3向け
[Shibboleth wiki] MultiFactorAuthnConfiguration