[SBS3] Spring Boot Sample SAML 2.0 Service Provider
====================
[![Build Status](https://travis-ci.org/vdenotaris/spring-boot-security-saml-sample.svg?branch=master)](https://travis-ci.org/vdenotaris/spring-boot-security-saml-sample)
[![DOI](https://zenodo.org/badge/22013861.svg)](https://zenodo.org/badge/latestdoi/22013861)
![GitHub release](https://img.shields.io/github/release/vdenotaris/spring-boot-security-saml-sample.svg)
[![GitHub forks](https://img.shields.io/github/forks/vdenotaris/spring-boot-security-saml-sample.svg)](https://github.com/vdenotaris/spring-boot-security-saml-sample/network)
[![GitHub stars](https://img.shields.io/github/stars/vdenotaris/spring-boot-security-saml-sample.svg)](https://github.com/vdenotaris/spring-boot-security-saml-sample/stargazers)
[![GitHub license](https://img.shields.io/badge/license-Apache%202-blue.svg)](https://raw.githubusercontent.com/vdenotaris/spring-boot-security-saml-sample/master/LICENSE)
---------
<img src="https://i.ibb.co/CKbFBzH/logo-small.png" align="right" />
## Project description
This project represents a sample implementation of a **SAML 2.0 Service Provider**, completely built on **Spring Framework**. In particular, it shows how to develop a web solution devised for Federated Authentication, by integrating **Spring Boot** and **Spring Security SAML**. The configuration has been completely defined using *Java annotations* (no XML).
**SSOCircle** ([ssocircle.com](http://www.ssocircle.com/en/portfolio/publicidp/)) is used as public Identity Provider for test purpose.
- **Author:** Vincenzo De Notaris ([dev@vdenotaris.com](mailto:dev@vdenotaris.com))
- **Website:** [www.vdenotaris.com](http://www.vdenotaris.com)
- **Version:** ` 2.3.1.RELEASE`
- **Last update**: February 15th, 2020
Thanks to *Vladimír Schäfer* ([github.com/vschafer](https://github.com/vschafer)) for supporting my work.
### References
#### Spring Boot
> Spring Boot makes it easy to create Spring-powered, production-grade applications and services with absolute minimum fuss. It takes an opinionated view of the Spring platform so that new and existing users can quickly get to the bits they need.
> - **Ref.:** [http://projects.spring.io/spring-boot/](http://projects.spring.io/spring-boot/)
#### Spring Security SAML Extension
> Spring SAML Extension allows seamless inclusion of SAML 2.0 Service Provider capabilities in Spring applications. All products supporting SAML 2.0 in Identity Provider mode (e.g. ADFS 2.0, Shibboleth, OpenAM/OpenSSO, Ping Federate, Okta) can be used to connect with Spring SAML Extension.
> - **Ref.:** [http://projects.spring.io/spring-security-saml/](http://projects.spring.io/spring-security-saml/)
---------
## Walkthrough
### Run as Docker container
To make it even easier, it is possible to run the project "as-is" also as Docker container. A valid account on [SSOCircle](https://www.ssocircle.com/en/) is needed to perform the authentication process.
**Run as container building a Docker image**
Run a pre-built fat-jar:
```
docker run -it --rm -p 8080:8080 -t vdenotaris/spring-saml-sp:latest
```
or compile the code and run the application with Maven:
```
docker run -it --rm -p 8080:8080 -t vdenotaris/spring-saml-sp:2.3.1-mvn-jdk-8
```
*Note: the related Docker image is publicly available on [Docker Hub](https://hub.docker.com/r/vdenotaris/spring-saml-sp/).*
The Service Provider is deployed as web application. Enter [http://localhost:8080/](http://localhost:8080/) in a browser to see the application running.
If you’re using Docker natively on Linux, Docker for Mac, or Docker for Windows, then the web app should now be listening on port 8080 on your Docker daemon host. Point your web browser to http://localhost:8080 to find the starting page. If this doesn’t resolve, you can also try [http://127.0.0.1:8080/](http://127.0.0.1:8080/).
If you’re using Docker Machine on a Mac or Windows, use `docker-machine ip MACHINE_VM` to get the IP address of your Docker host. Then, open *http://MACHINE_VM_IP:8080* in a browser. However, please note that the Service Provider is statically registered with localhost as endpoint on SSOCircle. Thus you need to reconfigure the application.
------
### Unit tests
I would like to say thank you to *Alexey Syrtsev* ([github.com/airleks](https://github.com/airleks)) for his contribution on unit tests.
| Metric | Result |
| ------------- | -----:|
| Coverage % | 99% |
| Lines Covered | 196 |
| Total Lines | 199 |
------
### Additional notes
1. The certificate on [https://idp.ssocircle.com/](https://idp.ssocircle.com/) seems to change on a fairly regular basis. This results in the following exception.
`javax.net.ssl.SSLPeerUnverifiedException: SSL peer failed hostname validation for name: null`
To update the SSOCircle certificates within the keystore, just run:
cd src/main/resources/saml/ && sh ./update-certifcate.sh
2. Sometimes SSO Circle could display you an error during the authenticaton process. In this case, please update your federation metadata directly on [https://idp.ssocircle.com](https://idp.ssocircle.com):
> Manage Metadata > Service Provider Metadata
Remove the current record and add a new one, using your FQDN and providing a new copy of your metadata: your can retrieve them at [http://localhost:8080/saml/metadata](http://localhost:8080/saml/metadata).
3. When the project version corresponds with the Spring Boot parent version, Maven may give you a warning as follows:
> Version is duplicate of parent version.
Actually there is nothing wrong with the used configuration, thus you can just ignore that message.
---------
### License
Copyright 2020 Vincenzo De Notaris
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
没有合适的资源?快使用搜索试试~ 我知道了~
spring-boot-security-saml-sample:SBS3 —基于Spring Boot构建的示例SAML 2....
共45个文件
java:14个
md:4个
html:4个
5星 · 超过95%的资源 需积分: 46 18 下载量 88 浏览量
2021-01-30
07:06:00
上传
评论 1
收藏 437KB ZIP 举报
温馨提示
[SBS3] Spring Boot示例SAML 2.0服务提供程序 项目描述 该项目代表完全基于Spring Framework构建的SAML 2.0 Service Provider的示例实现。 特别是,它展示了如何通过集成Spring Boot和Spring Security SAML开发为联合身份验证设计的Web解决方案。 使用Java注释(无XML)已完全定义了配置。 SSOCircle ( )用作测试的公共身份提供者。 作者: Vincenzo De Notaris( ) 网站: 版本: 2.3.1.RELEASE 最后更新:2020年2月15日 感谢VladimírSchäfer ( )支持我的工作。 参考文献 Sprint Boot 通过Spring Boot,可以轻松创建具有Spring支持的生产级应用程序和服务,而不必大惊小怪。 它从Spring平台的角度出发,以便新老用户都能快速找到所需的信息。 参考: : Spring Security SAML扩展 Spring SAML扩展允许在Spring应用程序中无缝包含SAML 2.0服务提供程序功
资源详情
资源评论
资源推荐
收起资源包目录
spring-boot-security-saml-sample-master.zip (45个子文件)
spring-boot-security-saml-sample-master
.github
FUNDING.yml 123B
ISSUE_TEMPLATE
bug_report.md 834B
feature_request.md 595B
CODEOWNERS 144B
workflows
main.yml 429B
src
test
java
com
vdenotaris
spring
boot
security
saml
web
controllers
LandingControllerTest.java 4KB
SSOControllerTest.java 3KB
core
CurrentUserHandlerMethodArgumentResolverTest.java 4KB
SAMLUserDetailsServiceImplTest.java 3KB
TestConfig.java 883B
CommonTestSupport.java 3KB
main
resources
application.properties 177B
saml
samlKeystore.jks 5KB
update-certifcate.sh 530B
templates
pages
index.html 3KB
discovery.html 2KB
landing.html 1KB
layout.html 3KB
static
img
favicon.ico 148KB
saml-flow.png 106KB
nyan-cat.png 89KB
spring-boot-saml.png 14KB
js
bootstrap.min.js.map 170KB
bootstrap.min.js 50KB
css
spring-saml-sp.css 946B
bootstrap.min.css.map 547KB
bootstrap.min.css 138KB
java
com
vdenotaris
spring
boot
security
saml
web
controllers
LandingController.java 2KB
SSOController.java 2KB
core
SAMLUserDetailsServiceImpl.java 2KB
CurrentUserHandlerMethodArgumentResolver.java 2KB
stereotypes
CurrentUser.java 986B
config
WebSecurityConfig.java 21KB
MvcConfig.java 2KB
Application.java 1KB
Dockerfile 3KB
CNAME 19B
.travis.yml 54B
LICENSE 11KB
README.md 6KB
pom.xml 6KB
Dockerfile.mvn 2KB
CODE_OF_CONDUCT.md 3KB
.gitignore 441B
_config.yml 27B
共 45 条
- 1
铭哲友野
- 粉丝: 31
- 资源: 4534
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论1