IdP関連
IdPで認証前にブラウザにエラー(SAML 2 SSO profile is not configured for relying party)
Error Message: SAML 2 SSO profile is not configured for relying party https://sp.example.ac.jp/shibboleth-sp
→relying-party.xmlにこのSPだけに対する特殊な<RelyingParty>設定があり、かつその中に SAML2SSOProfile
の設定が抜けているとこのエラーになります。
もしくは、このSPが最近追加されたものである場合、IdPが最新のメタデータ取得に失敗している可能性があります。
IdPで認証時にブラウザにエラー(Message was signed, but signature could not be verified.)
Shibboleth認証時にブラウザに下記のエラーが出力されます。
opensaml::FatalProfileException The system encountered an error at Tue Apr 30 12:13:14 2013 To report this problem, please contact the site administrator at root@localhost. Please include the following message in any email: opensaml::FatalProfileException at (https://sp.example.ac.jp/Shibboleth.sso/SAML2/POST) Message was signed, but signature could not be verified.
→IdPの設定ファイル relying-party.xml で <security:Credential id="IdPCredential"> の security:Certificate に設定している証明書(対応する秘密鍵は security:PrivateKey で指定されていること)と、学認申請システムに登録した証明書が一致することを確認してください。不一致である場合は上記のエラーが出力されます。
→参考情報 : https://wiki.shibboleth.net/confluence/display/SHIB2/NativeSPTroubleshootingCommonErrors#NativeSPTroubleshootingCommonErrors-Messagewassignedbutsignaturecouldnotbeverified
IdPで認証時にブラウザにエラー(Message expired, was issued too long ago.)
Shibboleth認証時にブラウザに下記のエラーが出力されます。
opensaml::SecurityPolicyException The system encountered an error at Tue Apr 30 12:13:14 2013 To report this problem, please contact the site administrator at root@localhost. Please include the following message in any email: opensaml::SecurityPolicyException at (https://sp.example.ac.jp/Shibboleth.sso/SAML2/POST) Message expired, was issued too long ago.
→IdPが動作しているホストの時刻がずれている場合に出力されます。NTPなどでホストの時刻を修正してください。
→参考情報 : https://wiki.shibboleth.net/confluence/display/SHIB2/NativeSPTroubleshootingCommonErrors#NativeSPTroubleshootingCommonErrors-opensamlSecurityPolicyExceptionMessageexpiredwasissuedtoolongago
attribute-filter.xmlに属性を送信するように設定しているはずなのに送信されない。
→attribute-filter.xml中のAttributeFilterPolicy要素のidが重複していると、最後のものしか有効にならないようです。idが重複しないように修正してください。
2.3.8もしくはそれ以前のIdPで認証前にログにエラー
1:19:57.770 - ERROR [org.opensaml.xml.security.SigningUtil:250] - Error during signature verification java.security.SignatureException: Signature length not correct: got 256 but was expecting 128
ブラウザには以下のエラーが表示されます。
Error Message: Message did not meet security requirements
以下の条件を全て満たす場合、認証要求(AuthnRequest)の署名検証時に確率的に問題が発生することが確認されています。IdPのバグで、2.4.0で修正されました。SPメタデータに記載されている不要な証明書を削除することにより回避可能です。
詳細: https://issues.shibboleth.net/jira/browse/JXT-99
- IdPがJava 7を使用している。
- 接続しようとしているSPのメタデータに1024bitの証明書と2048bitの証明書が混在している。
- SPが認証要求(AuthnRequest)に署名している。
aacli.shが実行できない問題の対処(その1)
Shibboleth IdPにはaacli.shというコマンドがあり、任意のSP(entityID)と任意のユーザ名を引数に与えることでSPに送出される属性がXMLで取得できます。IdP 2.3.5 ~ IdP 2.3.8ではIdPに含まれるファイルが変更となった影響でそのまま実行すると NoClassDefFoundError
となります。
$ sudo -u tomcat /opt/shibboleth-idp/bin/aacli.sh --configDir /opt/shibboleth-idp/conf/ --principal=test001 --requester=https://sp.example.ac.jp/shibboleth-sp Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'shibboleth.HandlerManager': Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: javax/servlet/ServletRequest at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:480) :
→ 上記エラーが出力された場合はTomcatのjarファイルを参照するようにしてください。
$ sudo ln -s $CATALINA_HOME/lib/servlet-api.jar /opt/shibboleth-idp/lib/
→ aacli.shコマンドの詳細は https://wiki.shibboleth.net/confluence/display/SHIB2/AACLI をご参照ください。
→ 参考情報 : 情報交換メーリングリストupki-fed:00419
この問題はIdP 2.4.0で修正されました。https://issues.shibboleth.net/jira/browse/SIDP-557 "servlet-api-2.5.jar"のようなファイル名で自動的に /opt/shibboleth-idp/lib/ にコピーされているはずです。
IdP 2.4.0にバージョンアップしたあとに以前作成した $CATALINA_HOME/lib/servlet-api.jar へのシンボリックリンクがある場合は削除してください。
aacli.shが実行できない問題の対処(その2)
StoredIDを用いている場合、mysql-connector-java-5.1.xx-bin.jar等のJDBCドライバーが適切に配置されていないと、下記のエラーになります。
Shibboleth IdPでStoredIDを利用するための設定方法(MySQL)を参照して /opt/shibboleth-idp/lib/ および /usr/java/tomcat/webapps/idp/WEB-INF/lib/ に配置されていることを確認してください。
# ./bin/aacli.sh --configDir=conf/ --principal="test001" --requester="https://test-sp1.gakunin.nii.ac.jp/shibboleth-sp" Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'shibboleth.AttributeResolver': Invocation of init method failed; nested exception is edu.internet2.middleware.shibboleth.common.service.ServiceException: Configuration was not loaded for shibboleth.AttributeResolver service, error creating components. ... Caused by: edu.internet2.middleware.shibboleth.common.service.ServiceException: Configuration was not loaded for shibboleth.AttributeResolver service, error creating components. ... Caused by: org.springframework.beans.factory.BeanCreationException: Unable to create relational database connector, JDBC driver can not be found on the classpath at edu.internet2.middleware.shibboleth.common.config.attribute.resolver.dataConnector.StoredIDDataConnectorBeanDefinitionParser.buildApplicationManagedConnection(StoredIDDataConnectorBeanDefinitionParser.java:169) ...
IdP起動時のエラー(The entity name must immediately follow the '&' in the entity reference.)
IdPを起動時に下記のエラーが idp-process.log に出力されます。
14:51:13.419 - INFO [edu.internet2.middleware.shibboleth.common.config.BaseService:158] - Loading new configuration for service shibboleth.RelyingPartyConfigurationManager 14:51:13.506 - ERROR [edu.internet2.middleware.shibboleth.common.config.BaseService:188] - Configuration was not loaded for shibboleth.RelyingPartyConfigurationManager service, error creating components. The root cause of this error was: org.xml.sax.SAXParseException: The entity name must immediately follow the '&' in the entity reference.
→上記のエラーは relying-party.xml にXML文法としての間違いがある場合に出力されます。
→例えば relying-party.xml にパスフレーズ付きの証明書を設定するとき、パスフレーズに '&' や '<' を含む場合はこれらの文字列をそのまま設定することはできません。これらの文字を含む場合は文字参照で &
や <
のように記述してください。
誤ったパスフレーズ設定例
<security:Credential id="IdPCredential" xsi:type="security:X509Filesystem"> <security:PrivateKey Password="myKeyPa$$word&"> /opt/shibboleth-idp/credentials/server-enc.key </security:PrivateKey>
正しいパスフレーズ設定例
<security:Credential id="IdPCredential" xsi:type="security:X509Filesystem"> <security:PrivateKey Password="myKeyPa$$word&"> /opt/shibboleth-idp/credentials/server-enc.key </security:PrivateKey>
SP関連
SPで認証後にエラー()
opensaml::FatalProfileException ... opensaml::FatalProfileExceptionat (https://sp.example.ac.jp/Shibboleth.sso/SAML2/POST) A valid authentication statement was not found in the incoming message.
→SPメタデータに記載されている証明書がSPにインストールされていない。
加えて、SPメタデータに複数証明書が記載されており、その一部がインストールされていない場合、タイミングによってエラーになったりならなかったりするので特に注意が必要。
SPからDSに遷移したときにDSでエラー
SPからDSに遷移したときにDSにて以下のようにブラウザにエラーが表示される。
エラー: 無効なクエリです The return URL 'https://sp.example.ac.jp/Shibboleth.sso/DS' could not be verified for Service Provider 'https://sp.example.ac.jp/shibboleth-sp'.
→学認技術ガイドに従ってSPを設定した場合、DSからのリターンURLは 'https://HOSTNAME/Shibboleth.sso/DS' となります。学認申請システムでSPの登録を行なうときに「DSからのリターンURL 」項目がこの値になっていない場合には上記のエラーが表示されます。
→なお、学認技術ガイドの「2.DSサーバの参照設定を行います。」において、SessionInitiatorのLocationを変更した場合にはDSからのリターンURLも変わります。例えば <SessionInitiator type="Chaining" Location="/ABC"...>
としたときのDSからのリターンURLは 'https://HOSTNAME/Shibboleth.sso/ABC' となります。また、shibboleth2.xmlにSessionInitiatorが1つも存在しない場合にはデフォルト値の 'https://HOSTNAME/Shibboleth.sso/Login' を使用してください。
SAML2でバックチャネル接続エラー
SAML2でIdPに接続したときに下記のようなバックチャネルの接続エラーが発生することがあります。
2012-11-16 17:45:00 ERROR Shibboleth.AttributeResolver.Query [6]: exception during SAML query to https://idp.example.ac.jp:8443/idp/profile/SAML2/SOAP/AttributeQuery: CURLSOAPTransport failed while contacting SOAP endpoint (https://idp.example.ac.jp:8443/idp/profile/SAML2/SOAP/AttributeQuery): connect() timed out! 2012-11-16 17:45:00 ERROR Shibboleth.AttributeResolver.Query [6]: unable to obtain a SAML response from attribute authority
→上記のエラーはIdP(idp.example.ac.jp)のattribute-filter.xmlに接続元SPへの属性送出設定がない(属性が受け渡されない)とき、SAML2でBack-Channelポートにfallbackするため発生します。IdP側のファイアウォールなどでBack-Channel(ポート8443)への接続が許可されていない場合にタイムアウトとなることがあります。いずれにしろ設定により属性は渡されませんので、このエラーによる実害は(ブラウザ表示の遅延以外は)特にありません。
→SAML2対応IdPのみ接続するときに「SPでBack-Channelを使用しないようにする設定」を以下に記載します。学認外のIdPと連携する場合など、SAML1で属性受け渡しをする可能性があるときは属性取得できなくなりますので、SAML2でかつBack-Channelを利用しないときだけに用いてください。
/etc/shibboleth/shibboleth2.xml で次の部分をコメントアウト
<!-- Use a SAML query if no attributes are supplied during SSO. --> <AttributeResolver type="Query" subjectMatch="true"/>
SP起動時のエラー(error while loading resource (/etc/shibboleth/shibboleth2.xml): XML error(s) during parsing, check log for specifics)
SPを起動時に下記のエラーが出力されます。
$ sudo /etc/init.d/shibd start Starting shibd: configuration is invalid, check console for specific problems [FAILED]
また /var/log/shibboleth/shibd.log には下記のエラーが出力されています。
2013-02-12 14:36:06 ERROR XMLTooling.ParserPool : fatal error on line 105, column 145, message: expected entity name for reference 2013-02-12 14:36:06 ERROR Shibboleth.Config : error while loading resource (/etc/shibboleth/shibboleth2.xml): XML error(s) during parsing, check log for specifics 2013-02-12 14:36:06 FATAL Shibboleth.Config : caught exception while loading configuration: XML error(s) during parsing, check log for specifics
→上記のエラーは shibboleth2.xml にXML文法としての間違いがある場合に出力されます。
→例えばCredentialResolverにパスフレーズ付きの証明書を設定するとき、パスフレーズに '&' や '<' を含む場合はこれらの文字列をそのまま設定することはできません。これらの文字を含む場合は文字参照で &
や <
のように記述してください。
誤ったパスフレーズ設定例
<CredentialResolver type="File" key="cert/server-enc.key" certificate="cert/server-enc.crt" password="myKeyPa$$word&"/>
正しいパスフレーズ設定例
<CredentialResolver type="File" key="cert/server-enc.key" certificate="cert/server-enc.crt" password="myKeyPa$$word&"/>