spring saml tutorialで説明したように、私は私がw3.domクラスが見つからない問題を克服するためのpom.xmlにHTTPステータス401 - 認証に失敗しました:エラーデコードし、着信SAMLメッセージ
<dependency>
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
<version>1.4.01</version>
</dependency>
を追加することを除いて、すべてをしました。サンプルプロジェクトを実行すると、ブラウザには HTTP Status 401 - Authentication Failed: Error decoding incoming SAML message
、コンソールには(CertPathPKIXTrustEvaluator.java:81) ERROR org.springframework.security.saml.trust.MetadataCredentialResolver - PKIX path construction failed for untrusted credential: [subjectName='CN=idp.ssocircle.com' |credential entityID='https://idp.ssocircle.com']: unable to find valid certification path to requested target
と表示されます。
DAY 2: 私はkeytool -importcert -alias identtrustca -file ca.cer -keystore samlKeystore.jks
を実行して、新しい生成ものとsecurity/samlKeystore.jks
を交換してください。 securityContext.xml
:
<bean id="keyManager" class="org.springframework.security.saml.key.JKSKeyManager">
<constructor-arg value="classpath:security/samlKeystore.jks"/>
<constructor-arg type="java.lang.String" value="nalle123"/>
<constructor-arg>
<map>
<entry key="apollo" value="nalle123"/>
</map>
</constructor-arg>
<constructor-arg type="java.lang.String" value="apollo"/>
</bean>
それから私は持っている:
<bean id="keyManager" class="org.springframework.security.saml.key.JKSKeyManager">
<constructor-arg value="classpath:security/samlKeystore.jks"/>
<constructor-arg type="java.lang.String" value="123456"/>
<constructor-arg>
<map>
<entry key="apollo" value="123456"/>
</map>
</constructor-arg>
<constructor-arg type="java.lang.String" value="apollo"/>
</bean>
するとコンソールは言う:
Servlet.service() for servlet [jsp] in context with path [/spring-security-saml2-sample] threw exception
java.lang.RuntimeException: Key for alias apollo not found
at org.springframework.security.saml.metadata.MetadataGenerator.getServerKeyInfo(MetadataGenerator.java:201)
を使用
keytool
がとき
Caused by: java.io.IOException: Keystore was tampered with, or password was incorrect
at sun.security.provider.JavaKeyStore.engineLoad(Unknown Source)
at sun.security.provider.JavaKeyStore$JKS.engineLoad(Unknown Source)
at java.security.KeyStore.load(Unknown Source)
at org.springframework.security.saml.key.JKSKeyManager.initialize(JKSKeyManager.java:117)
... 57 more
Caused by: java.security.UnrecoverableKeyException: Password verification failed
... 61 more
は、それから私は私が入ったものにパスワードを変更します
だから私はidenttrustca
にapollo
を変更します。
<bean id="keyManager" class="org.springframework.security.saml.key.JKSKeyManager">
<constructor-arg value="classpath:security/samlKeystore.jks"/>
<constructor-arg type="java.lang.String" value="123456"/>
<constructor-arg>
<map>
<entry key="identtrustca" value="123456"/>
</map>
</constructor-arg>
<constructor-arg type="java.lang.String" value="identtrustca"/>
</bean>
とコンソールは言う:
Servlet.service() for servlet [jsp] in context with path [/spring-security-saml2-sample] threw exception
java.lang.UnsupportedOperationException: trusted certificate entries are not password-protected
は、その後、私はthisとthisを読んで、私は(私はそれが秘密鍵のものであると考えている)entry要素を削除し、それは次のようになります。
<bean id="keyManager" class="org.springframework.security.saml.key.JKSKeyManager">
<constructor-arg value="classpath:security/samlKeystore.jks"/>
<constructor-arg type="java.lang.String" value="123456"/>
<constructor-arg>
<map/>
</constructor-arg>
<constructor-arg type="java.lang.String" value="identtrustca"/>
</bean>
今の問題は、次のようになります。
Servlet.service() for servlet [jsp] in context with path [/spring-security-saml2-sample] threw exception
java.lang.RuntimeException: Key with alias identtrustca doesn't have a private key
DAY 2第二の部分: は今、私の代わりに新しいキーストアを作成する私は古いsamlKeystore.jksを使用する必要があることを理解しています。 keytool -list -V -keystore d:\temp\samlKeystore.jks
を使用している場合、3つの項目が含まれていることがわかります(もともとは2です)。
SPがIdPメタデータから公開鍵を取得する理由はわかりませんが、依然としてIdPのca.cerは必要ですか?それは1と異なっているが、私は今、私が午前、私が代わりにError decoding incoming SAML message
を得るための今、またopenssl s_client -connect idp.ssocircle.com:443 -showcerts
により取得し、認証Webサイトからca.cerは、IdPの証明書であると考えていHTTP Status 401 - Authentication Failed: Response issue time is either too old or with date in the future
DAY 3 SPを起動したときに、クロムとFirefoxの両方からhttp://localhost:8080/spring-security-saml2-sample/にアクセスしたときに、あるエクスプローラでグローバルログアウトを押して、もう一方をリフレッシュすると、ログアウトページは表示されません。私はSSOのために、同じSPからのグローバルログアウトはマルチセッションを無視しなければならないと考えました。例えば、一度グローバルログインしてからもう一度ログアウトすると、ログアウトページが表示されます。もう一方のエクスプローラも(私がリフレッシュする場合)。実際には、複数のSP、私は1つにログアウト1のために、私は一度に記録されたすべてのSPにログアウトを見ることができるはずです。
DAY N SAMLプロジェクトのURLを変更することにより、一つはメタデータを変更する必要がありますidp.ssocircle.com(メタデータの管理)。そうしないと、idpのWebサイトにエラーが表示されます。これはdocs/reference/htmlsingle/index.htmlに書かれています
http://stackoverflow.com/questions/40991685/saml-error-pkix-path-construction-failed-for-untrusted-credentialを参照してください。 –
@VladimírSchäferこんにちは、私は質問2日目を更新しました。どうもありがとうございます。 – Tiina
@VladimírSchäfer2日目の2日目を参照してください。2日目はクリアされています。 :) – Tiina