Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/daggerok/spring-cloud-security-oauth2-sso-github
Secure you spring-boot apps by using OAuth2 (GitHub) SSO quickly
https://github.com/daggerok/spring-cloud-security-oauth2-sso-github
oauth2 oauth2-authentication oauth2-client oauth2-githubclient oauth2-sso sso sso-authentication sso-client sso-github
Last synced: 19 days ago
JSON representation
Secure you spring-boot apps by using OAuth2 (GitHub) SSO quickly
- Host: GitHub
- URL: https://github.com/daggerok/spring-cloud-security-oauth2-sso-github
- Owner: daggerok
- Created: 2020-04-26T22:35:44.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-04-26T22:47:54.000Z (almost 5 years ago)
- Last Synced: 2024-11-11T15:37:22.353Z (3 months ago)
- Topics: oauth2, oauth2-authentication, oauth2-client, oauth2-githubclient, oauth2-sso, sso, sso-authentication, sso-client, sso-github
- Language: Kotlin
- Size: 61.5 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# secure your spring app with SSO [![CI](https://github.com/daggerok/spring-cloud-security-oauth2-sso-github/workflows/CI/badge.svg)](https://github.com/daggerok/spring-cloud-security-oauth2-sso-github/actions?query=workflow%3ACI)
Secure you spring-boot apps by using OAuth2 (GitHub) SSO quickly (Servlet API / legacy)## step: 0
1. build and run:
```bash
./gradlew -p step-0-no-security clean build bootRun
```
1. test:
```bash
curl 0:8080
http :8080
```## step: 1
1. build and run:
```bash
./gradlew -p step-1-basic-security clean build bootRun
```
1. test:
```bash
curl -u ololo:trololo 0:8080
http -a ololo:trololo :8080
```## step: 2
1. create `./step-2-oauth2-sso-security/src/main/resources/application-github.properties` file with content like:
```properties
security.oauth2.client.clientId=bd1c0a783ccdd1c9b9e4
security.oauth2.client.clientSecret=1a9030fbca47a5b2c28e92f19050bb77824b5ad1
```
this information can be fetched from you personal github account. you must create application for GitHub SSO.
1. build and run:
```bash
./gradlew -p step-2-oauth2-sso-security clean build bootRun
```
1. open http://127.0.0.1:8080
1. first time, you will be redirected on GitHub page for login
1. after success auth you will see result
1. next time you will be authenticated automatically## resources
* https://cloud.spring.io/spring-cloud-static/spring-cloud-security/2.2.1.RELEASE/reference/html/
* https://www.baeldung.com/spring-security-oauth2-enable-resource-server-vs-enable-oauth2-sso
* https://www.baeldung.com/spring-security-oauth