使用 SAML 对 Spring Boot 应用程序进行身份验证的问题

     2023-02-27     271

关键词:

【中文标题】使用 SAML 对 Spring Boot 应用程序进行身份验证的问题【英文标题】:Issue using SAML for authentication with spring boot app 【发布时间】:2018-04-16 19:07:36 【问题描述】:

我目前正在阅读this article,了解如何使用 Spring Boot 应用程序设置 SAML。

我按照所有步骤操作,只是将单点登录 URL 从“https://localhost:8443/saml/SSO”更改为“https://localhost:8443/mycompanysaml/SSO”。

当我运行应用程序时,我在 IDE 控制台中没有看到任何错误,但是 Okta 的登录页面没有显示在浏览器上。我有以下消息。 Error message in the browser

控制台中消息的堆栈跟踪如下:

2017-11-03 15:21:23.991  INFO 50013 --- [nio-8443-exec-7] o.a.c.c.C[Tomcat].[localhost].[/]       : Initializing Spring FrameworkServlet 'dispatcherServlet'
2017-11-03 15:21:23.991  INFO 50013 --- [nio-8443-exec-7]o.s.web.servlet.DispatcherServlet        : FrameworkServlet'dispatcherServlet': initialization started
2017-11-03 15:21:24.006  INFO 50013 --- [nio-8443-exec-7]o.s.web.servlet.DispatcherServlet        : FrameworkServlet'dispatcherServlet': initialization completed in 15 ms
2017-11-03 15:21:24.021  INFO 50013 --- [nio-8443-exec-7]o.s.s.s.m.MetadataGeneratorFilter        : No default metadata configured, generating with default values, please pre-configure metadata for production use
2017-11-03 15:21:24.060  INFO 50013 --- [nio-8443-exec-7]o.s.s.s.m.MetadataGeneratorFilter        : Created default metadata for system with entityID: https://localhost:8443/saml/metadata
2017-11-03 15:21:24.708  INFO 50013 --- [nio-8443-exec-7].s.m.p.AbstractReloadingMetadataProvider : New metadata succesfullyloaded for 'https://dev-531605.oktapreview.com/app/exkcp2fsptqmfDGtf0h7/sso/saml/metadata'
2017-11-03 15:21:24.720  INFO 50013 --- [nio-8443-exec-7].s.m.p.AbstractReloadingMetadataProvider : Next refresh cycle for metadata provider 'https://dev-531605.oktapreview.com/app/exkcp2fsptqmfDGtf0h7/sso/saml/metadata' will occur on '2017-11-04T01:21:24.240Z' ('2017-11-03T18:21:24.240-07:00' local time)
2017-11-03 15:21:24.865  INFO 50013 --- [io-8443-exec-10]o.s.security.saml.log.SAMLDefaultLogger:AuthNRequest;SUCCESS;0:0:0:0:0:0:0:1;https://localhost:8443/saml/metadata;http://www.okta.com/exkcp2fsptqmfDGtf0h7;;;

有人可以解释一下发生了什么吗?是不是因为我把 Single Sign On URL 改成了我自己的,应该没问题吧?

提前感谢您的帮助。 G.

【问题讨论】:

是的,我相信这是因为您更改了 URL。 https://localhost:8443/saml/SSO 是 Spring Security 希望您使用的 URL - 我不确定您是否可以更改它。 @MattRaible 登录时会话多长时间? @MattRaible 我更改了 URL 并且它有效。但我真的很想了解为什么我们不能更改那个 url。 【参考方案1】:

您在应用程序中为 SAML 设置的配置将有一个与 SAML 相关的弹簧安全过滤器,您已在其中添加了过滤器。

因此,如果您想更改 SSO url,则必须更改配置文件中声明的过滤器中的 url。

对于您所指的应用程序正在使用默认配置。

了解更多信息。 http://www.sylvainlemoine.com/2016/06/06/spring-saml2.0-websso-and-jwt-for-mobile-api/ 看看这个

【讨论】:

是否有用于将 SAML 与 Spring Boot 应用程序集成的 Spring Boot SAML 客户端?

】是否有用于将SAML与SpringBoot应用程序集成的SpringBootSAML客户端?【英文标题】:IsthereaSpringbootSAMLclientforintegratingSAMLwithspringbootapplication?【发布时间】:2021-05-0406:15:04【问题描述】:我正在开发一个与多个Idp集成的SpringBoot应用程... 查看详情

在 ELB 后面使用带有 Spring Boot 的 SAML 重定向到 http 而不是 https

】在ELB后面使用带有SpringBoot的SAML重定向到http而不是https【英文标题】:UsingSAMLwithSpringBootbehindanELBredirectstohttpinsteadofhttps【发布时间】:2019-04-2112:48:23【问题描述】:我正在尝试使用Okta对来自SpringBoot应用程序的用户进行身份验... 查看详情

Okta/Spring Boot Saml 应用程序进入无限循环

】Okta/SpringBootSaml应用程序进入无限循环【英文标题】:Okta/SpringBootSamlapplicationentersinfiniteloop【发布时间】:2018-10-2510:48:54【问题描述】:我遵循了这个指南:https://dzone.com/articles/get-started-with-spring-boot-saml-and-okta一开始一切都很... 查看详情

单个 Spring Boot 应用程序中的 SAML 和 Oauth2

】单个SpringBoot应用程序中的SAML和Oauth2【英文标题】:SAMLandOauth2inasinglespringbootapplication【发布时间】:2019-06-1123:44:45【问题描述】:为了尝试为我正在从事的项目开发通用身份服务,我需要在单个spring-boot应用程序中支持UI页面... 查看详情

将 Spring Boot Security SAML 与 Azure AD Gallery 应用程序集成为多租户

...2707:23:57【问题描述】:我正在开发JavaSpringBoot系统并尝试使用SAML单点登录与Azure非图库应用程序集成。我找到了如何创建非图库应用程序,如 查看详情

使用 spring-security-saml 在应用程序中没有配置 IDP 错误

】使用spring-security-saml在应用程序中没有配置IDP错误【英文标题】:NoIDPwasconfigurederrorinappusingspring-security-saml【发布时间】:2015-03-1909:14:30【问题描述】:我正在使用SpringBoot和SpringSecuritySAML基于https://github.com/vdenotaris/spring-boot-secu... 查看详情

使用 Spring Boot 拦截 SAML Http 请求

】使用SpringBoot拦截SAMLHttp请求【英文标题】:SAMLHttpRequestInterceptwithSpringBoot【发布时间】:2018-07-1103:20:25【问题描述】:关于这个SO问题AddrequestparametertoSAMLrequestusingSpringSecuritySAML我想用我自己的替换默认的HTTPRedirectDeflateBindingbean... 查看详情

使用 Spring Security Saml 和 SP 应用程序的无状态会话

】使用SpringSecuritySaml和SP应用程序的无状态会话【英文标题】:StatelessSessionswithSpringSecuritySamlandSPApplication【发布时间】:2016-10-3008:28:34【问题描述】:我尝试运行启动示例springsecuritysamlboot,https://github.com/vdenotaris/spring-boot-security... 查看详情

Spring Boot 和 SAML 2.0

】SpringBoot和SAML2.0【英文标题】:SpringBootandSAML2.0【发布时间】:2014-06-0217:27:30【问题描述】:有没有办法将SAML2.0集成到基于SpringBoot的应用程序中?我想实现自己的SP并与远程IdP通信。【问题讨论】:【参考方案1】:我实现了一... 查看详情

Spring Boot 在本地环境中禁用 SAML 安全性

...onment【发布时间】:2016-11-2611:29:28【问题描述】:我正在使用springboot1.4.0+spring-security-saml2-core1.0.2并借助以下链接Spring-Boot-Saml-example它运行良好。现在我想在我的本地环境(本地PC)中禁 查看详情

基于 SAML 的 SSO 用于身份验证和 LDAP 用于授权 - Spring Boot Security

...-09-2721:06:21【问题描述】:将Gsuite与CloudIdentity专业版结合使用a)将GSuite初始化为iDP,作为SSO的SAML应用程序b)用于读取 查看详情

使用 Spring Security SAML 和 Spring Boot 在 MetadataGeneratorFilter 上设置实体基本 URL

】使用SpringSecuritySAML和SpringBoot在MetadataGeneratorFilter上设置实体基本URL【英文标题】:SettingentityBaseURLonMetadataGeneratorFilterwithSpringSecuritySAMLandSpringBoot【发布时间】:2018-10-1000:18:21【问题描述】:我收到以下警告。如何设置entityBaseURL... 查看详情

Spring SAML 实现无法解析对 bean 的引用

...展。我从spring安全扩展页面下载了源代码。根据手册,我使用mvnpackage打包了扩展,并使用mvndeploy命令将 查看详情

如何配置 Spring Security SAML 以与 Okta 一起使用?

】如何配置SpringSecuritySAML以与Okta一起使用?【英文标题】:HowdoIconfigureSpringSecuritySAMLtoworkwithOkta?【发布时间】:2015-02-2702:16:20【问题描述】:我正在尝试使spring-boot-security-saml-sample应用程序与Okta一起工作。要将Okta添加为提供程... 查看详情

如何使用 SPRING SAML EXTENSION 使我们的 webapp 成为身份提供者?

】如何使用SPRINGSAMLEXTENSION使我们的webapp成为身份提供者?【英文标题】:HowtouseSPRINGSAMLEXTENSIONtomakeourwebappasanidentityprovider?【发布时间】:2014-07-2703:24:00【问题描述】:所有,这是我的要求。我们有一个当前的JAVAWeb应用程序,它... 查看详情

Angular(SPA) 前端和 Spring Boot 后端的 SAML 2.0 集成

...API)与SAML2.0集成,并且我的身份提供者是keycloak。我已经使用SAML2-js库与前端 查看详情

没有 Spring Boot 的 Spring Security SAML 身份元数据

】没有SpringBoot的SpringSecuritySAML身份元数据【英文标题】:SpringSecuritySAMLIdentityMetadataWITHOUTSpringBoot【发布时间】:2022-01-1309:46:03【问题描述】:我不断看到以下用于注册SAML身份提供者的代码块:spring:security:saml2:relyingparty:registratio... 查看详情

使用 Postgresql 对 Spring Boot 应用程序进行 Dockerizing

】使用Postgresql对SpringBoot应用程序进行Dockerizing【英文标题】:DockerizingSpringBootAppwithPostgresql【发布时间】:2016-07-1300:06:09【问题描述】:我正在尝试为使用PostgreSQL作为数据库的SpringBoot应用程序创建一个Docker容器。我的目标是构... 查看详情