比較バージョン

キー

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

認証方法の変更、設定(証明書による認証)

LDAPを利用したIDShibboleth IdPではLDAPを利用したID/パスワード認証の他に、様々な認証方法を利用することが可能です。以下では、クライアント証明書を利用した認証の設定方法を示します。

...

こちらの手順は、RemoteUserを使いクライアント証明書での認証を行えるような設定となります。

RemoteUserを有効にする

・(過去のバージョンのShibboleth IdPの場合)RemoteUserモジュールを有効にする

Shibboleth IdPのバージョンが44.1.0以降かつ5.0.0以降では同意機能はモジュール化されており、利用するには有効化操作が必要です。以下のコマンドを実行してください。(当該モジュールがすでに有効化されているかを確認し、有効化されていない場合に有効化するものです)0未満では以下で利用するRemoteUserログインフロー機能はモジュール化されており、利用するには有効化操作が必要でした。該当するバージョンをお使いの場合は以下のコマンドを実行してください。(当該モジュールがすでに有効化されているかを確認し、有効化されていない場合に有効化するものです)

パネル
borderColor#cccccc
bgColor#eeeeee
borderStylesolid

# /opt/shibboleth-idp/bin/module.sh -t idp.authn.RemoteUser || /opt/shibboleth-idp/bin/module.sh -e idp.authn.RemoteUser

...

パネル
borderColor#cccccc
bgColor#eeeeee
borderStylesolid

#### RemoteUser ####
(省略)
# Most other settings need to be supplied via web.xml to the servlet#idp.authn.RemoteUser.checkHeaders =
idp.authn.RemoteUser.checkHeaders = REMOTE_USER
idp.authn.RemoteUser.supportedPrincipals = \

saml2/urn:oasis:names:tc:SAML:2.0:ac:classes:X509, \
saml2/urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient, \
saml1/urn:ietf:rfc:2246

...

パネル
borderColor#cccccc
bgColor#eeeeee
borderStylesolid

(省略)
<VirtualHost _default_:443>
(省略)
ProxyPass /idp/ http://localhost:8080/idp/ connectiontimeout=5 timeout=15

<Location /idp/Authn/RemoteUser>
SSLVerifyClient require
SSLVerifyDepth 3
SSLRequireSSL
# SSLOptions +ExportCertData +StdEnvVars
SSLUserName SSL_CLIENT_S_DN_CN
SSLRequire %{SSL_CLIENT_S_DN_O} eq "Test_University_A"
RequestHeader set REMOTE_USER %{REMOTE_USER}s
RewriteEngine On
RewriteCond %{SSL:REMOTE_USER} =""
RewriteRule .* - [E=REMOTEUSERNULL]
RequestHeader unset REMOTE_USER env=REMOTEUSERNULL
</Location>
SSLCACertificateFile /opt/shibboleth-idp/credentials/cacert.pem

(省略) </VirtualHost>

・/opt/shibboleth-idp/edit-webapp/WEB-INF/web.xmlに対象ヘッダREMOTE_USERを追加

web.xmlに以下の内容を追加します。

solid

#SSLProtocol all -SSLv3
#SSLProxyProtocol all -SSLv3
SSLProtocol all -SSLv3 -TLSv1.3 

パネル
borderColor#cccccc
bgColor#eeeeee
borderStyle

(省略)

<!-- Servlet protected by container used for RemoteUser authentication -->
<servlet>
<servlet-name>RemoteUserAuthHandler</servlet-name>
<servlet-class>net.shibboleth.idp.authn.impl.RemoteUserAuthServlet</servlet-class>
<init-param>
<param-name>checkHeaders</param-name>
<param-value>REMOTE_USER</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>RemoteUserAuthHandler</servlet-name>
<url-pattern>/Authn/RemoteUser</url-pattern>
</servlet-mapping>

(省略)

以下を実行して、反映させます。

/VirtualHost>


ApacheとJettyを再起動します。

パネル
borderColor#cccccc
bgColor#eeeeee
borderStylesolid

# /opt/shibboleth-idp/bin/build.shsystemctl restart httpd

# systemctl restart jetty

複数の認証手段を使う場合

複数の認証手段を使うのでなければ以上で完了です。

複数の認証手段を使う(冒頭の複数の認証手段(ログインフロー)を使う(冒頭のidp.authn.flowsPassword|X509 のように複数記述する)場合で、デフォルトの認証手段(SPからの認証要求時に認証手段についての指定がない場合に遷移する認証手段)を指定したい場合には、conf のように複数記述する)場合で、デフォルトのログインフロー(SPからの認証要求時に認証手段についての指定がない場合に遷移するログインフロー)を指定したい場合には、4.1以降の場合は、各ログインフロー idp.authn.*.order プロパティを調整してください。数字を指定し、小さいものが高優先度となります。
4.0.xおよびそれ以前の場合は、conf/authn/general-authn.xmlのbeanの順序を変更してください。上にあるものが優先的に選択されます。例えば3.4.0の初期設定では authn/X509 のbeanが authn/Password のbeanより上にあるため、証明書認証が優先されます。

さらに、特定のSPに対して証明書認証以外を利用させたくない場合は、さらに、一部の条件で(例えば特定のSPに対して)証明書認証以外を利用させたくない場合は、relying-party.xmlの設定で のshibboleth.RelyingPartyOverrides設定で p:authenticationFlows="#{{'X509'}}" のように利用可能な認証手段を指定してください。

...