Shibboleth搭建idp和阿里云SSO集成-资料汇总

sso配置

1.idp安装,配置 nameid为啥没有生效

attribute-filter.xml配置文件没有写对

<!--value="https://signin.aliyun.com/xxxxxx/saml/SSO" 要和主账号ID的sso配置相同 -->
	<AttributeFilterPolicy id="aliyun">
        <PolicyRequirementRule xsi:type="Requester" value="https://signin.aliyun.com/xxxxxx/saml/SSO" />
            <AttributeRule attributeID="mail">
                <PermitValueRule xsi:type="ANY" />
            </AttributeRule>
    </AttributeFilterPolicy>

2.域名绑定 idp 部署tomcat服务 运维童鞋开发80、443端口号,构建tomcat服务(安装证书,设置私匙密码)

3.阿里云sso 用户sso配置,上传metadata.xml

4.企业后台 配置jaas认证用户,添加用户账号和密码

 

数据中台dataphin的域名

 

idp主动登录 绕过ram登录页面

web登录阿里云的auth

https://help.aliyun.com/document_detail/93696.html?spm=a2c4g.11186623.6.643.4e4353e81pNW8O

1.需要配置sso auth

https://signin.aliyun.com/oauth2/v1/auth?
client_id=123****
redirect_uri=https%3A%2F%2Fyourwebapp.com%2Fauthcallback%2F&
response_type=code&
scope=openid%20%2Facs%2Fccc&
access_type=offline&
state=123456****

A出发的地方从这里安装

巴梨的两篇教程 安装 Shibboleth

https://yq.aliyun.com/articles/350531?tdsourcetag=s_pcqq_aiomsg&do=login&accounttraceid=87b0f203-5d81-4cb7-a986-49615e3962e2#

 

SSO场景系列:实现Shibboleth+JAAS+Mysql到阿里云的单点登录

https://yq.aliyun.com/articles/365171?spm=a2c4e.11155435.0.0.452c7a1f9c0xGN

 

另外一篇讲解samlrequest的文章

阿里云子账号SAML SSO流程分析

https://yq.aliyun.com/articles/491811?spm=a2c4e.11155435.0.0.452c7a1fF1Rmk2

 

实现Shibboleth+JAAS+Mysql到阿里云的单点登录 相同的一篇文章

https://blog.csdn.net/weixin_34311757/article/details/90120057

 

 

idp概念 sp的概念

saml1.0、saml2.0、flow、global.xml、 attribute-filter.xml、attribute-resolver.xml、replying-party.xml

jaas的配置

password_authn_config.xml、jaas.config

https://wiki.shibboleth.net/confluence/display/CONCEPT/Home

 

一手资料

官网教程

https://wiki.shibboleth.net/confluence/display/IDP30/RelyingPartyConfiguration

 

https://wiki.shibboleth.net/confluence/display/SHIB2/IdPUnsolicitedSSO

 

UnsolicitedSSOConfiguration

https://wiki.shibboleth.net/confluence/display/IDP30/UnsolicitedSSOConfiguration

 

https://shibboleth.1660669.n2.nabble.com/unsolicited-sso-td7005076.html

 

类似阿里云的saml管理配置服务商

https://www.gluu.org/docs/ce/admin-guide/saml/

 

providerId 阿里云的

(Craft a URL like this: https://idp.gluu.host.loc/idp/profile/SAML2/Unsolicited/SSO?providerId=https%3A%2F%2Fsphost-shib.site%3a8443%2Fshibboleth,)

 

中文教程 概念 sso的saml

http://www.blogjava.net/security/archive/2006/10/02/sso_in_action.html

https://www.cnblogs.com/gimmeangel/p/3920736.html

https://www.cnblogs.com/perfectdesign/archive/2008/04/10/saml_federation.html saml的面纱

 

csdn的教程

Shibboleth SSO 登录流程

https://blog.csdn.net/xiangguiwang/article/details/54880619

基于shibboleth的分布式认证之IDP配置

https://blog.csdn.net/sjbup/article/details/8840443

 

Shibboleth搭建IDP服务

https://blog.csdn.net/SuperCrrazy/article/details/82491454

 

阿里云官网教程

单点登录sso

https://help.aliyun.com/document_detail/110499.html?spm=a2c4g.11186623.6.622.17d4d19ekMuGl0

auth认证

https://help.aliyun.com/document_detail/93696.html?spm=a2c4g.11186623.6.643.2a4553e8JKViAt

 

案例

oxford的idp

https://secure.account.oup.com/idp/profile/SAML2/Unsolicited/SSO?execution=e3s1

standford的idp gitlab

https://code.stanford.edu/et-puppet/idp3

工具类 saml decode

https://idp.ssocircle.com/sso/toolbox/samlDecode.jsp?spm=a2c4e.10696291.0.0.6cf919a4mY4U8m&file=samlDecode.jsp

 

如果有问题可以联系我,邮箱:904582819#163.com,#替换为@

如果此篇文章有用的话,可以支持下小弟我的生意,河南宁陵贡梨个大酥甜~

 

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
好的,下面是 Spring Boot 集成 SAML 2.0 的步骤: 1. 首先,在 pom.xml 中添加 Spring Security SAML 依赖: ```xml <dependency> <groupId>org.springframework.security.extensions</groupId> <artifactId>spring-security-saml2-core</artifactId> <version>1.0.10.RELEASE</version> </dependency> ``` 2. 配置 SAML 相关的属性,可以在 application.properties 或者 application.yml 文件中添加以下属性: ```properties # SAML SP 配置 saml2.metadata-url=https://idp.example.com/metadata saml2.entity-id=https://sp.example.com/metadata saml2.private-key=classpath:/saml/private.key saml2.certificate=classpath:/saml/certificate.crt saml2.credentials-issuer=SP Entity ID saml2.name-id=urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified saml2.sign-metadata=true saml2.sign-requests=true saml2.sign-responses=true ``` 3. 创建 SAML 配置类,继承 SAMLConfigurerAdapter 并重写 configure 方法: ```java @Configuration @EnableWebSecurity public class SAMLConfig extends SAMLConfigurerAdapter { @Autowired private SAMLUserDetailsService samlUserDetailsService; @Override public void configure(HttpSecurity http) throws Exception { http .authorizeRequests() .antMatchers("/saml/**").permitAll() .anyRequest().authenticated() .and() .apply(saml()) .userDetailsService(samlUserDetailsService) .sso() .defaultSuccessURL("/home") .and() .logout() .logoutSuccessUrl("/") .and() .metadata() .defaultIDP() .singleSignOnService() .binding("urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect") .url("https://idp.example.com/sso") .and() .entityID("https://idp.example.com/metadata") .and() .and() .keyManager() .privateKeyDERLocation("classpath:/saml/private.key") .publicKeyPEMLocation("classpath:/saml/certificate.crt"); } @Bean public SAMLConfigurer saml() { return new SAMLConfigurer(); } } ``` 这里的 SAMLUserDetailsService 是自定义的用户服务,用于根据 SAML 断言中的信息获取用户信息。 4. 创建 SAMLUserDetailsService 类,实现 SAMLUserDetailsService 接口: ```java @Service public class SAMLUserDetailsServiceImpl implements SAMLUserDetailsService { @Override public Object loadUserBySAML(SAMLCredential credential) throws UsernameNotFoundException { // 根据断言中的信息获取用户信息 String username = credential.getNameID().getValue(); List<GrantedAuthority> authorities = new ArrayList<>(); authorities.add(new SimpleGrantedAuthority("ROLE_USER")); return new User(username, "", authorities); } } ``` 5. 创建 SAML 元数据文件,保存在 classpath:/saml/metadata.xml 中: ```xml <?xml version="1.0" encoding="UTF-8"?> <EntityDescriptor xmlns="urn:oasis:names:tc:SAML:2.0:metadata" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:shibmd="urn:mace:shibboleth:metadata:1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" entityID="https://sp.example.com/metadata"> <SPSSODescriptor protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol"> <KeyDescriptor use="signing"> <ds:KeyInfo> <ds:X509Data> <ds:X509Certificate> <!-- 将 SP 的公钥放在这里 --> </ds:X509Certificate> </ds:X509Data> </ds:KeyInfo> </KeyDescriptor> <SingleLogoutService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect" Location="https://sp.example.com/saml/logout"/> <NameIDFormat>urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified</NameIDFormat> <AssertionConsumerService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="https://sp.example.com/saml/acs" index="1"/> </SPSSODescriptor> </EntityDescriptor> ``` 6. 创建 SP 的私钥和证书,保存在 classpath:/saml/private.key 和 classpath:/saml/certificate.crt 中。 至此,我们完成了 Spring Boot 集成 SAML 2.0 的全部步骤。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值