準備中
元ネタ: https://github.com/korteke/Shibboleth-IdP3-TOTP-Auth
releasesタブから 上記ページのreleasesタブから totpauth-impl-NNN-bin.zip をダウンロード、展開。
...
conf/authn/general-authn.xmlの <util:list id="shibboleth.AvailableAuthenticationFlows">
に以下を挿入。 の子要素として以下を挿入します。TOTPの優先順位を高くしたければ先頭に挿入してください。
コード ブロック | ||
---|---|---|
| ||
<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> </property> </bean> |
conf/authn/totp-authn-beans.xmlにLDAPの情報を記述します。ldap.propertiesに記述している場合は以下のように修正してください。LDAPのbindDNの権限で読み込みに加えて書き込みもできることを確認しておいてください。
コード ブロック | ||
---|---|---|
| ||
@@ -37,10 +37,10 @@
</bean>
<bean id="contextSource" class="org.springframework.ldap.core.support.LdapContextSource">
- <property name="url" value="LDAP_SERVER_URL" />
- <property name="base" value="BASE_DN" />
- <property name="userDn" value="MANAGERS DN" />
- <property name="password" value="PASSWORD" />
+ <property name="url" value="%{idp.attribute.resolver.LDAP.ldapURL}" />
+ <property name="base" value="%{idp.attribute.resolver.LDAP.baseDN}" />
+ <property name="userDn" value="%{idp.attribute.resolver.LDAP.bindDN}" />
+ <property name="password" value="%{idp.attribute.resolver.LDAP.bindDNCredential}" />
</bean>
<bean id="ldapTemplate" class="org.springframework.ldap.core.LdapTemplate"> |
以下は3.3向け修正。
flows/authn/Totp/Totp-flow.xmlに登録のための遷移が宣言されていないので追加します。
コード ブロック | ||
---|---|---|
| ||
@@ -26,6 +26,7 @@
result="viewScope.custom" />
</on-render>
+ <transition on="RegisterToken" to="RegisterToken" />
<transition on="proceed" to="ExtractTotpFromForm" />
</view-state>
|
conf/authn/password-authn-config.xmlにパスワードを持ち回る必要があるため以下の行を追加します。
コード ブロック |
---|
@@ -23,6 +23,8 @@
<bean id="shibboleth.authn.Password.PasswordFieldName" class="java.lang.String" c:_0="j_password" />
<bean id="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"/> |
最後に、Tomcatを起動したまま/opt/shibboleth-idp/bin/rebuild.shを実行し、WARファイル再作成およびデプロイします。