SAP saml2 元数据 HTTP 错误

使⽤事务 SAML2 或 SAML2_IDP 在 ABAP 系统中配置 SAML 2.0 时, Web 页⾯返回 403 已禁⽌、 404 未找到 或 500 服务器内部错误。
 

在事务 SAML2 中下载元数据时, ⽹页返回 403 已禁⽌、 404 未找到或 500 服务器内部错误。
 

在事务 SAML2_IDP 中下载元数据时, ⽹页返回 403 已禁⽌、 404 未找到或 500 服务器内部错误。


提醒: 服务 /sap/saml2/idp/metadata 在 ABAP 系统中不存在
 

原因


对于 403 已禁⽌或 500 服务器内部错误, 所需的 ICF 服务不处于活动状态。
对于 404 未找到错误, 缺少所需的外部别名。
 

解决⽅案
对于 403 禁⽌或 500 服务器内部错误, 在事务 SICF 中激活以下 ICF 服务:
在 SAML2 场景中:
/sap/bc/webdynpro/sap/saml2
/sap/public/bc/sec/saml2
/sap/public/bc/sec/cdc_ext_service


在 SAML2_IDP 场景中:
/sap/bc/saml2/idp/sso
/sap/bc/webdynpro/sap/SAML2_IDP


在这两种场景中:
根据 SAP Note 517484 - Internet 通信框架中的⾮活动服务, ⽤于 ABAP 系统的所有 HTTP 访问的基础服务。
如果已应⽤ SAP Note 2142551, 请激活允许清单服务*
1. 运⾏事务 SICF。
2. 输⼊服务名称并搜索。
 

详细信息参考:

2323725 - 事务 SAML2 或 SAML2_IDP 返回 HTTP 错误 403、 404 或 500
 

要生成Spring Boot SAML SP(服务提供者)元数据,您可以使用以下步骤: 1. 添加spring-security-saml2-core依赖 在Maven或Gradle项目中添加以下依赖: Maven: ``` <dependency> <groupId>org.springframework.security.extensions</groupId> <artifactId>spring-security-saml2-core</artifactId> <version>1.0.10.RELEASE</version> </dependency> ``` Gradle: ``` implementation 'org.springframework.security.extensions:spring-security-saml2-core:1.0.10.RELEASE' ``` 2. 创建SAML SP配置类 创建一个Java类,例如"SAMLSecurityConfig",并添加以下注释: ``` @Configuration @EnableWebSecurity public class SAMLSecurityConfig extends WebSecurityConfigurerAdapter { // ... } ``` 在此类中,您需要配置Spring Security SAML的各种组件,例如SAML身份提供者和SAML服务提供者。您可以参考Spring Security SAML文档以获取更多详细信息。 3. 添加SAML SP元数据生成器 添加以下bean定义以启用SAML SP元数据生成器: ``` @Bean public SAMLConfigurer saml() { return new SAMLConfigurer(); } ``` 然后,您可以使用以下代码生成元数据: ``` @Bean public SAMLConfigurer.EndpointConfigurer samlSPServiceConfigurer() throws Exception { // ... return saml().sso().defaultSuccessURL("/home").and(); } @Bean public SAMLConfigurer.MetaDataGenerator samlSPMetadataGenerator() { SAMLConfigurer.MetaDataGenerator metaDataGenerator = new SAMLConfigurer.MetaDataGenerator(); metaDataGenerator.setEntityId("http://localhost:8080/saml/metadata"); metaDataGenerator.setBindingsSLO(Arrays.asList("redirect", "post")); metaDataGenerator.setBindingsSSO(Arrays.asList("redirect", "post")); metaDataGenerator.setEntityBaseURL("http://localhost:8080"); metaDataGenerator.setIncludeDiscoveryExtension(false); metaDataGenerator.setExtendedMetadataDelegate(samlSPExtendedMetadataDelegate()); return metaDataGenerator; } ``` 在此示例中,您需要提供实体ID,绑定SLO(单点注销)和SSO(单点登录)以及实体基本URL。您还可以为元数据生成器设置其他选项,例如扩展元数据委托。 4. 配置SAML SP安全性 最后,您需要配置SAML SP的安全性。例如,以下代码可确保只有经过身份验证的用户可以访问SAML SP: ``` @Override protected void configure(HttpSecurity http) throws Exception { http.authorizeRequests() .antMatchers("/saml/**").authenticated() .anyRequest().permitAll(); } ``` 这是一个基本的Spring Boot SAML SP元数据生成的示例。您可以根据您的需求进行自定义和配置。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值