首页 > 解决方案 > Spinnaker 和 Okta 集成失败

问题描述

场景:将 Spinnaker 升级到 1.12.0。没有其他会影响此集成的配置更改(我们不得不修改 s3 IAM,因为它停止工作)。Okta 集成停止工作。在入口的安装过程中重新发布了公钥,可能相关吗?

SAML-TRACE 显示有效载荷到达 okta 并返回

Spinnaker 会根据浏览器和我到达那里的方式抛出两个不同的错误。

直接链接到甲板 url:(500) 未配置 IDP,请使用至少一个 IDP 更新包含的元数据(在浏览器和门中看到)

okta 仪表板中的 Okta“chicklet”:(401)身份验证失败:传入的 SAML 消息无效

配置细节(同样没有改变):直接下载元数据 JKS 正在被利用并且是有效的服务 url 已确认 JKS 的别名已确认

标签: oktaspinnaker

解决方案


从 1.10.13 升级到 1.12.2 时,我也遇到了这个问题。我在 Gate 的日志中发现了很多这样的错误消息:

2019-02-19 05:31:30.421 ERROR 1 --- [.0-8084-exec-10] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw e
xception [org.opensaml.saml2.metadata.provider.MetadataProviderException: No IDP was configured, please update included metadata with at least one IDP] with root cause

org.opensaml.saml2.metadata.provider.MetadataProviderException: No IDP was configured, please update included metadata with at least one IDP
        at org.springframework.security.saml.metadata.MetadataManager.getDefaultIDP(MetadataManager.java:795) ~[spring-security-saml2-core-1.0.2.RELEASE.jar:1.0.2.RELEASE]
        at org.springframework.security.saml.context.SAMLContextProviderImpl.populatePeerEntityId(SAMLContextProviderImpl.java:157) ~[spring-security-saml2-core-1.0.2.RELEASE.jar
:1.0.2.RELEASE]
        at org.springframework.security.saml.context.SAMLContextProviderImpl.getLocalAndPeerEntity(SAMLContextProviderImpl.java:127) ~[spring-security-saml2-core-1.0.2.RELEASE.ja
r:1.0.2.RELEASE]
        at org.springframework.security.saml.SAMLEntryPoint.commence(SAMLEntryPoint.java:146) ~[spring-security-saml2-core-1.0.2.RELEASE.jar:1.0.2.RELEASE]
        at org.springframework.security.web.access.ExceptionTranslationFilter.sendStartAuthentication(ExceptionTranslationFilter.java:203) ~[spring-security-web-4.2.9.RELEASE.jar
:4.2.9.RELEASE]
...

降级回 1.10.13 后,我升级到下一个版本 1.11.0,发现问题就从那时开始。最终,我查看了 Gate 在 Container 启动时的日志,发现:

2019-02-20 22:31:40.132 ERROR 1 --- [0.0-8084-exec-3] o.o.s.m.provider.HTTPMetadataProvider    : Error retrieving metadata from https://000000000000.okta.com/app/00000000000000000/sso/saml/metadata

javax.net.ssl.SSLException: Error in hostname verification
        at org.opensaml.ws.soap.client.http.TLSProtocolSocketFactory.verifyHostname(TLSProtocolSocketFactory.java:241) ~[openws-1.5.4.jar:na]
        at org.opensaml.ws.soap.client.http.TLSProtocolSocketFactory.createSocket(TLSProtocolSocketFactory.java:186) ~[openws-1.5.4.jar:na]
        at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707) ~[commons-httpclient-3.1.jar:na]
        at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387) ~[commons-httpclient-3.1.jar:na]
...

这让我意识到 TLS 证书被 Gate 拒绝了。不知道为什么它突然开始无法通过检查。到目前为止,我已将其配置为:

$ hal config security authn saml edit --metadata https://000000000000.okta.com/app/00000000000000000/sso/saml/metadata

我最终下载了元数据文件并使用halyard.

$ wget https://000000000000.okta.com/app/00000000000000000/sso/saml/metadata
$ hal config security authn saml edit --metadata "${PWD}/metadata"
$ hal config version edit --version 1.12.2
$ hal deploy apply

按照 Spinnaker 文档的建议打开了一个私人浏览器窗口,Gate 开始再次正确重定向到 Okta。

问题归档,https://github.com/spinnaker/spinnaker/issues/4017


推荐阅读