Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/musabbozkurt/oauth2-authorization-server
OAuth2 Authorization Server with Spring Boot 3 and Java 21
https://github.com/musabbozkurt/oauth2-authorization-server
java-21 mariadb oauth2-authorizationserver spring-boot-3 spring-security springdoc-openapi testcontainers
Last synced: 3 months ago
JSON representation
OAuth2 Authorization Server with Spring Boot 3 and Java 21
- Host: GitHub
- URL: https://github.com/musabbozkurt/oauth2-authorization-server
- Owner: musabbozkurt
- Created: 2023-03-24T19:41:45.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-07-06T21:01:45.000Z (7 months ago)
- Last Synced: 2024-10-12T06:14:24.257Z (4 months ago)
- Topics: java-21, mariadb, oauth2-authorizationserver, spring-boot-3, spring-security, springdoc-openapi, testcontainers
- Language: Java
- Homepage:
- Size: 87.9 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## OAuth2 Authorization Server with Spring Boot 3 and Java 21
#### Prerequisites
- Java 21 should be installed --> `export JAVA_HOME=$(/usr/libexec/java_home -v 21)`
- Maven should be installed
- Docker should be installed
- Postman can be installed#### How to Run and Test
- Run `mvn test` or `mvn clean install` or `mvn clean package` command to run all the tests
- `mvn spring-boot:run`
- Import [OAuth2 Authorization Server.postman_collection.json](OAuth2%20Authorization%20Server.postman_collection.json)
- Swagger: http://localhost:9000/swagger-ui/index.html
- Click `Authorize` and enter the following credentials
- `client_id`: `client`
- `client_secret`: `secret`
- Use one of the following default values to log in http://localhost:9000/login
- username: `Developer` password: `password`
- username: `Admin` password: `password`
- username: `User` password: `password`
- Database credentials
- `url`: `jdbc:mariadb://localhost:3306/oauth2_authorization_server`
- `username`: `mb_test`
- `password`: `test`### References
- [Spring Boot 3 Tutorial Security OAuth2 Spring Authorization Server Save login data to a database](https://www.youtube.com/watch?v=rVAqh-VDw2o)
- [BCryptPasswordEncoderTests](https://github.com/spring-projects/spring-security/blob/main/crypto/src/test/java/org/springframework/security/crypto/bcrypt/BCryptPasswordEncoderTests.java)