身份验证成功后,SSO idp 发起重定向到之前的 URL

SSO idp initiated redirect to previous URL after successful authentication

我是 spring 安全和 SAML2 的新手,我被要求使用 SAML2 在 spring-安全 SP 中实施 SSO。在用户尝试从 SP 接收未经授权的资源后,我试图执行由 IDP(在我的例子中是 SSOcircle)发起的 SSO。之后,idp 将用户从身份验证中重定向,当身份验证阶段成功完成时,用户将被重定向到 https://localhost/webinterface/saml/SSO instead of the resource the user tried to reach, If the resource the user wanted to reach was for example: https://localhost:443/webinterface/webui 如何让 Idp 将用户重定向回相同的 URL?

SAML 服务提供商在向 IDP 发送 AuthnRequest 时必须为参数 RelayState 提供最终目的地的值(在您的情况下:https://localhost:443/webinterface/webui)。在身份验证成功后,IDP 将通过 SAML 响应发回相同的值。这是针对 SP 发起的 SAML SSO。

通过 IDP 发起的 SSO,您可以使用 URL

https://idp.ssocircle.com/sso/idpssoinit?metaAlias=%2Fpublicidp&spEntityID=<YOUR SERVICE PROVIDER ENTITY ID>&RelayState=<finalURL>