问题标签 [spring-saml]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
spring - Spring Security 和嵌套 FilterChainProxy 编写 SAML Service Provider
我试图找出一个涉及 Spring Security 和 SAML 的问题。我们正在尝试使用 Spring Security (spring-security-core-3.1.1.RELEASE.jar) 和 SAML (spring-security-saml2-core-1.0.0-RC1-SNAPSHOT.jar) 将我们的产品修改为SAML SP。编辑:这是我的安全相关上下文 xml 的(我认为!)相关部分。如您所见,它几乎与此示例 XML相同。
症状是,在通过 IDP 进行身份验证后,我的 SP 页面立即正确显示;但是,更改 URL(例如单击任何链接)会使我立即返回 IDP。我想我已经找到了原因,但我不知道为什么并非总是如此。
我对 Spring Security 的理解是,授权检查都是基于 SecurityContextHolder 的。即,在持有者上放置一个 Authentication 对象,然后一切都围绕它进行身份验证检查。然后 SecurityContextPersistenceFilter 负责维护会话存储库以匹配。
因此,当我跟踪 Spring Security 代码时,我看到 SecurityContextPersistenceFilter 带有以下代码:
到目前为止,一切都很好。然后,我查看 FilterChainProxy 并发现:
这似乎还可以。由于 FilterChainProxy 应该只被调用一次,在所有 Spring Security 过滤器的基础上,此时清除 SecurityContextHolder 不是问题。
然而,这不是正在发生的事情。实际发生的是,在 SecurityContextPersistenceFilter 有机会将其从上下文中读取到 contextAfterChainExecution 之前,FilterChainProxy 中的 clearContext 被调用。发生这种情况的原因是因为 FilterChainProxy 实际上在调用链中出现了两次。我知道这一点是因为我在 FilterChainProxy.doFilter 中设置了一个断点,并且它被调用了两次。第一次调用时,它的 FilterChain 中有另一个 FilterChainProxy 实例。这是 FilterChainProxy 的 getFilters 方法返回的过滤器堆栈:
有了这个过滤器链,我不明白 SecurityContextPersistenceFilter 是如何工作的:似乎 SecurityContextHolder 在有机会持久化之前总是被清除。
这里有什么明显的错误吗?我是否误解了 Spring Security 中的某些内容(很可能!)
spring-security - OpenAM 的 Spring Security SAML HTTP Post 错误
我对 Vladimir 的 Spring Security 演示有疑问。默认情况下,当我将绑定和断言使用者服务更改为 HTTP-POST 时,我收到以下错误...
IDPSSOFederate.doSSOFederate: Unable to do sso or federation.
com.sun.identity.saml2.common.SAML2Exception: Cannot resolve element with ID xxxx
...由于 XMLSignatureException。
我注意到 OpenAM 正在尝试将我重定向到,http://localhost:8080/SSOPOST/metaAlias/idp
但是在 IdP 元数据中它被指定为http://localhost:8080/openam/SSOPOST/metaAlias/idp
.
显然我收到了 404 错误,但我无法弄清楚为什么它将我重定向到没有应用程序上下文的 SSOPOST url。
向上滚动日志,我可以看到较早的 getRemoteServiceURL NullPointerException,但从我所读到的内容来看,这是正常 OpenAM 日志的一部分吗?
我的配置使用默认 SOAP 设置对 OpenAM 进行了很好的身份验证。为什么 HTTP-POST 会有所不同?
spring-security - LDAP 用户组
如何获取用户所属的用户组列表(作为属性)。我想使用 LDAP 服务器作为 SAML 身份验证源,然后我想将 LDAP 属性映射到 SAML 属性,并将它们用于基于 J2EE 应用程序组的角色管理的 spring-saml 身份验证。我此时所做的是 LDAP->SAML->Spring-security (SAML 模块) 身份验证。但是登录后我无法获取组,因为 LDAP 没有将它们与其他信息(cn、电子邮件、gidNumber 等)一起返回
spring - SP 元数据签名
我正在使用 Spring Security SAML 扩展并遇到了签署 SP 元数据的能力。SP 元数据签名的用例是什么?对于元数据生成器的自定义,我需要删除此功能并想知道此类更改的后果(如果不签署 SP 元数据,我将在安全性方面松懈)。
谢谢!
spring - Spring SAML ADFS:java.security.InvalidKeyException
我的任务是实现对带有 LDAP 的 Active Directory 联合服务 (SSL) 的可访问性。首先我不得不说我在 ADFS 和 SAML 方面的经验非常少。我决定采用 Spring Security SAML Extension 来实现此功能。我从 GIThub 下载并安装 Spring Security 项目的 SAML 扩展: https ://github.com/spring-projects/spring-security-saml
我在官方文档 http://docs.spring.io/spring-security-saml/docs/1.0.x/reference/html/ 下的“6. IDP 集成指南”点下找到了我已经完成的说明。
- 我从 ADFS-Server 下载元数据
- 我将下载的元数据存储在 saml2-sample/WEB-INF/src/main/resources/security/FederationMetadata.xml 下,并增强了 securityContext.xml 的描述方式
- 启动 Web 应用程序后,系统会自动生成元数据文档
- 我创建了一个 metadata.xml 并将其提供给 ADFS 服务器的系统管理员
- 系统管理员完成其余的点。
在此之后我想测试登录。在我选择 IDP 并单击登录按钮后,我被要求提供凭据。传输凭据后,我得到以下结果/异常:
有人可以帮我解决这个问题吗?
最好的问候托马斯
java - 使用 Spring Security SAML 扩展更改身份验证类型
我已经测试了 Spring Security SAML Extension 以集成到我的项目中,它对我来说看起来不错。但是我对这个实现有一个问题:如何将身份验证更改为基于表单的登录?
我有一个带有登录表单的应用程序。并且要求是身份验证针对 Active Directory 联合身份验证服务。但到目前为止,我在 SAML 扩展中找不到任何方法。
很抱歉这个问题,但我在 Spring Security 方面的经验不是很好。我希望这里的人能以简单的方式帮助我。
最好的问候托马斯
spring - 无法让 Spring SAML2 工作
我似乎无法让 saml2 工作。这是我所做的。
我从这里下载了示例应用程序:https ://github.com/spring-projects/spring-security-saml ,这是他们文档中的链接:http: //docs.spring.io/spring-security-saml/ docs/1.0.x/reference/html/chapter-quick-start.html
1) 将示例应用程序“saml2-sample”转换为 eclispe 项目:mvn eclipse:eclipse
2)构建项目:mvn package
3) 在项目中添加了“Dynamic Web Module”方面:
右键单击项目>属性>项目方面
4) 在 STS 服务器上运行应用程序:
右键单击项目>运行方式>在服务器上运行
服务器启动,控制台中的一切看起来都正常,除了在 URL 处加载的HTTP Status 404 - /spring-security-saml2-sample/
url http://localhost:8080/spring-security-saml2-sample/
jquery - Spring saml 在每个请求上都会命中 idp
我一直在将我在 spring 中开发的 web 应用程序与 spring saml 集成以进行单点登录。按照此链接上的教程进行操作。
它按预期工作。验证用户并重定向到我的应用程序。我面临的唯一问题是所有请求,例如单击菜单栏中的选项卡,甚至单击一些内部链接,应用程序调用 idp 来验证用户。并且由于应用程序中的 ajax-jquery 调用因错误而中断:“请求的资源上不存在 'Access-Control-Allow-Origin' 标头。因此不允许访问 Origin 'sp_host_name'。”
我的配置与提到的链接中解释的相同。如果有人知道此问题的解决方案,请提供帮助。
spring-security - How to configure the samlIDPDiscovery bean in my new SecurityContext.xml?
I've recently started reading about SAML and trying to implement something similar to the Spring's SAML-sample project to my existing Java Application(so please spare me if I ask something stupid!). My existing application has a Login.jsp which asks for user credentials and do the validation accordingly to login. I would like to implement the idea of SSO for my application. So to start with, I've understood the Spring Saml-sample project quite well. In its SecurityContext.xml the samlIDPDiscovery bean is configured as:
The idpSelection.jsp has the following html part code:
So If I want to implement similar to above by doing appropriate changes to my Login.jsp and securityContext.xml for selecting appropriate IdP and redirecting to the selected Idp's Landing page on clicking login, how should I proceed? I've tried doing this since so long but I couldn't. Any help is highly appreciated.
java - SAML 服务提供者 Spring Security
使用预配置的服务提供者元数据时,在 Spring Security 中,扩展元数据委托是否应该有 2 个 bean 定义?一个用于 IDP 元数据,一个用于 SP 元数据?