...
として設定を行い、クライアント証明書が有効な証明書であり、かつ、上記の条件を満たす場合に認証を行う設定としています。
こちらの手順は、RemoteUserを使いクライアント証明書での認証を行えるような設定となります。
・RemoteUserを有効にする
4.1.0以降では同意機能はモジュール化されており、利用するには有効化操作が必要です。以下のコマンドを実行してください。(当該モジュールがすでに有効化されているかを確認し、有効化されていない場合に有効化するものです)
パネル | ||||||
---|---|---|---|---|---|---|
| ||||||
|
・/opt/shibboleth-idp/conf/
...
authn/authn.properties の変更
クライアント証明書を用いた認証のために idpauthn.properties ファイルを変更します。
パネル | ||||||||
---|---|---|---|---|---|---|---|---|
| (省略)||||||||
|
このままだとRemoteUserが証明書認証とみなされないので、以下の設定も加える。
パネル | ||||||
---|---|---|---|---|---|---|
| ||||||
|
・/etc/httpd/conf.d/ssl.confへの追加(赤文字の個所を追加)
※SSLVerifyClientがrequireのため問題ないはずだが、万が一証明書認証に失敗してもIdPに到達した場合REMOTE_USERヘッダに"(null)"が入ってくるため、フェイルセーフとしてrewriteの条件を入れている。
パネル | ||||||
---|---|---|---|---|---|---|
| ||||||
SSLCACertificateFile /opt/shibboleth-idp/credentials/Camp-CA.crt SSLVerifyClient require SSLVerifyDepth 3 SSLRequireSSL SSLOptions +ExportCertData +StdEnvVars SSLUserName
|
・/opt/shibboleth-idp
...
/edit-webapp/WEB-INF/web.xmlに対象ヘッダREMOTE_USERを追加
LDAP から属性を取得する際のキーとなる属性はデフォルトでは uid ですが変更したい場合は下記の場所を変更します。web.xmlに以下の内容を追加します。
パネル | ||||||
---|---|---|---|---|---|---|
| ||||||
idp.attribute.resolver.LDAP.trustCertificates = %{
idp.attribute.resolver.LDAP.searchFilter = (uid=$resolutionContext.principal) ←必要に応じて変更 idp.attribute.resolver.LDAP.returnAttributes = cn,homephone,mail (省略) |
複数の認証手段を使うのでなければ以上で完了です。
|
以下を実行して、反映させます。
パネル | ||||||
---|---|---|---|---|---|---|
| ||||||
|
またApacheとJettyも再起動します。
パネル | ||||||
---|---|---|---|---|---|---|
| ||||||
|
複数の認証手段を使う場合
複数の認証手段を使うのでなければ以上で完了です。
複数の認証手段(ログインフロー)を使う(冒頭のidp.authn.flows
に Password|X509
のように複数記述する)場合で、デフォルトのログインフロー(SPからの認証要求時に認証手段についての指定がない場合に遷移するログインフロー)を指定したい場合には、4.1以降の場合は、各ログインフロー idp.authn.*.order
プロパティを調整してください。数字を指定し、小さいものが高優先度となります。
4.0.xおよびそれ以前の場合は、conf複数の認証手段を使う(つまりidp.authn.flows
に複数記述する)場合で、この証明書認証をデフォルトにしたい(SPからの認証要求時に認証手段についての指定がない場合に証明書認証に遷移させたい)場合には、conf/authn/general-authn.xmlのbeanの順序を変更してください。上にあるものが優先的に選択されます。.xmlのbeanの順序を変更してください。上にあるものが優先的に選択されます。例えば3.4.0の初期設定では authn/X509
のbeanが authn/Password
のbeanより上にあるため、証明書認証が優先されます。
さらに、一部の条件で(例えば特定のSPに対して)証明書認証以外を利用させたくない場合は、さらに、特定のSPに対して証明書認証以外を利用させたくない場合は、relying-party.xml
の設定で のshibboleth.RelyingPartyOverrides設定で p:authenticationFlows="#{{'X509'}}"
のように利用可能な認証手段を指定してください。
トラブルシューティング
Apacheではクライアント証明書が認識されているがその情報がTomcatに伝わっていない場合、Tomcatを使っている場合で、Apacheではクライアント証明書が認識されているがその情報がTomcatに伝わっていない場合、/usr/share/tomcat/conf/server.xmlの8009番ポートConnectorにtomcatAuthentication="false"が設定されていることを確認してください。
参考: jdk 8、tomcat 7をインストールする
参考
IdPv3の証明書認証の詳細: Shibboleth Wiki: X509AuthnConfiguration