16

通常、Spring SAMLベースのサービス プロバイダー (SP)実装は正常に動作しますが、次のエラーが返されることがあります。

[2014-07-17 16:00:58.767] boot - 1078 DEBUG [http-bio-80-exec-1] --- BaseMessageDecoder:     Successfully decoded message.
[2014-07-17 16:00:58.767] boot - 1078 DEBUG [http-bio-80-exec-1] --- BaseSAMLMessageDecoder: Checking SAML message intended destination endpoint against receiver endpoint
[2014-07-17 16:00:58.768] boot - 1078 DEBUG [http-bio-80-exec-1] --- BaseSAMLMessageDecoder: Intended message destination endpoint: https://prismasp.cloud.reply.eu:443/MIUR_PRISMA-2.1-WEBUI/saml/SSO/alias/defaultAlias
[2014-07-17 16:00:58.768] boot - 1078 DEBUG [http-bio-80-exec-1] --- BaseSAMLMessageDecoder: Actual message receiver endpoint: http://prismasp.cloud.reply.eu:443/MIUR_PRISMA-2.1-WEBUI/saml/SSO/alias/defaultAlias
[2014-07-17 16:00:58.768] boot - 1078 ERROR [http-bio-80-exec-1] --- BaseSAMLMessageDecoder: SAML message intended destination endpoint 'https://prismasp.cloud.reply.eu:443/MIUR_PRISMA-2.1-WEBUI/saml/SSO/alias/defaultAlias' did not match the recipient endpoint 'http://prismasp.cloud.reply.eu:443/MIUR_PRISMA-2.1-WEBUI/saml/SSO/alias/defaultAlias'
[2014-07-17 16:00:58.782] boot - 1078 DEBUG [http-bio-80-exec-1] --- SAMLProcessingFilter: Incoming SAML message is invalid
org.opensaml.xml.security.SecurityException: SAML message intended destination endpoint did not match recipient endpoint
...

私は ( Spring Securityのデフォルト設定として) SSLを有効にしたTomcat 7HTTP Strict Transport Security (HSTS)を使用しています。

このエラーを修正する方法はありますか?


注:サンプル ソース コードはGithubにあります: vdenotaris/spring-boot-security-saml-sample

4

3 に答える 3

31

問題がランダムに発生する理由はわかりませんが、少なくとも 1 つの修正方法SAMLContextProviderLBは、現在の の代わりに構成することですSAMLContextProviderImpl

SAMLContextProviderLB通常、リバース プロキシまたはロード バランサーで使用されるパブリック URL について Spring SAML パブリックに通知するために使用されますが、この場合、Spring SAML に HTTPS を使用していると強制的に認識させるために使用できます。詳細については、Spring SAML マニュアルの10.1 高度な構成の章を参照してください。

entityBaseURLまた、 Bean にプロパティを適切に設定する必要がありますMetadataGenerator。これを行わないと、生成されるメタデータは、http と https のどちらを使用してアプリケーションに最初の要求を行ったかによって異なります。繰り返しますが、これはすべて文書化されています。

于 2014-07-17T16:56:31.163 に答える