简体   繁体   English

OKTA SSO SAML响应

[英]OKTA SSO SAML Response

Trying to setup a SSO for a Java web application built with Spring MVC. 尝试为使用Spring MVC构建的Java Web应用程序设置SSO。 I've registered my application to an OKTA server, got a Metadata URL and a SignOn URL. 我已经将应用程序注册到OKTA服务器,获得了元数据URL和登录URL。 I'm using the SignOn URL from my application, authenticating with success, then a POST request is made with some form data that include a SAML Response object. 我正在使用应用程序中的SignOn URL,并成功进行身份验证,然后使用包含SAML响应对象的某些表单数据发出POST请求。

What should be the next step from here? 从这里下一步应该怎么做? I've decoded the SAML response, and now from my understanding I need to get a token or a session ID that I'll need to use to my further requests to the OKTA server. 我已经解码了SAML响应,现在,根据我的理解,我需要获取令牌或会话ID,将其用于对OKTA服务器的进一步请求。

Edit 1: Ran the spring-boot-saml-example , the authentication works as expected. 编辑1:运行spring-boot-saml-example ,身份验证按预期工作。 But, when trying to get the current session using OKTA Session API from the Spring application, an HTTP 404 code is returned. 但是,当尝试使用Spring应用程序中的OKTA Session API获取当前会话时,将返回HTTP 404代码。 Fetching the current session using the browser work fine. 使用浏览器获取当前会话可以正常工作。

Take a look at this blog post , this example uses Spring Security and an Okta SAML app . 看一下这篇博客文章 ,该示例使用Spring Security和Okta SAML应用程序。 Take a look at that, and if that doesn't help let us know. 看一看,如果这样做没有帮助,请告诉我们。

You can use the spring-webmvc-pac4j security library which provides SAML authentication for Spring MVC (Boot) app. 您可以使用spring-webmvc-pac4j安全性库 ,该为Spring MVC(引导)应用程序提供SAML身份验证。

Configuration is straightfoward for Okta like for any other SAML identity provider: https://github.com/pac4j/spring-webmvc-pac4j-demo/blob/master/src/main/webapp/WEB-INF/demo-servlet.xml#L44 + https://github.com/pac4j/spring-webmvc-pac4j-demo/blob/master/src/main/webapp/WEB-INF/demo-servlet.xml#L214 与其他任何SAML身份提供商一样,Okta的配置也很简单: https : //github.com/pac4j/spring-webmvc-pac4j-demo/blob/master/src/main/webapp/WEB-INF/demo-servlet.xml #L44 + https://github.com/pac4j/spring-webmvc-pac4j-demo/blob/master/src/main/webapp/WEB-INF/demo-servlet.xml#L214

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM