{"id":16407579,"url":"https://github.com/musabbozkurt/oauth2-authorization-server","last_synced_at":"2025-10-10T22:09:22.728Z","repository":{"id":247125121,"uuid":"618582955","full_name":"musabbozkurt/oauth2-authorization-server","owner":"musabbozkurt","description":"OAuth2 Authorization Server with Spring Boot 3 and Java 24","archived":false,"fork":false,"pushed_at":"2025-09-10T11:01:37.000Z","size":10091,"stargazers_count":4,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-10T15:13:59.932Z","etag":null,"topics":["ai-advisor","aot-compilation","archunit-junit5","coordinated-restore-at-checkpoint","docker","flyway","java-24","mapstruct","mariadb","mcp-client","mcp-server","oauth2-authorizationserver","ollama","redis","retrieval-augmented-generation","spring-boot-3","spring-security","springdoc-openapi","testcontainers","vector-database"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/musabbozkurt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-03-24T19:41:45.000Z","updated_at":"2025-09-10T11:01:12.000Z","dependencies_parsed_at":"2024-11-09T21:44:33.378Z","dependency_job_id":"eb6c7fdb-8081-4bcc-a099-eb6569f8f2ed","html_url":"https://github.com/musabbozkurt/oauth2-authorization-server","commit_stats":null,"previous_names":["musabbozkurt/oauth2-authorization-server"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/musabbozkurt/oauth2-authorization-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/musabbozkurt%2Foauth2-authorization-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/musabbozkurt%2Foauth2-authorization-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/musabbozkurt%2Foauth2-authorization-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/musabbozkurt%2Foauth2-authorization-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/musabbozkurt","download_url":"https://codeload.github.com/musabbozkurt/oauth2-authorization-server/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/musabbozkurt%2Foauth2-authorization-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279005458,"owners_count":26083898,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-advisor","aot-compilation","archunit-junit5","coordinated-restore-at-checkpoint","docker","flyway","java-24","mapstruct","mariadb","mcp-client","mcp-server","oauth2-authorizationserver","ollama","redis","retrieval-augmented-generation","spring-boot-3","spring-security","springdoc-openapi","testcontainers","vector-database"],"created_at":"2024-10-11T06:14:17.228Z","updated_at":"2025-10-10T22:09:22.722Z","avatar_url":"https://github.com/musabbozkurt.png","language":"Java","funding_links":[],"categories":["⚙️ DevOps"],"sub_categories":[],"readme":"## OAuth2 Authorization Server with Spring Boot 3 and Java 24\n\n#### Prerequisites\n\n- Java 24 should be installed --\u003e `export JAVA_HOME=$(/usr/libexec/java_home -v 24)`\n- Maven should be installed\n- Docker should be installed\n- Postman can be installed\n\n#### How to Run and Test\n\n- Run `export DEEPSEEK_API_KEY=your_api_key_here` command to set DeepSeek API key\n- Run `docker-compose up -d` command to run necessary services\n- Run `mvn test` or `mvn clean install` or `mvn clean package` or `./mvnw clean install` command to run all the tests\n- Run `mvn spring-boot:run` command to run the application\n- Import the followings to test in Postman\n    - [OAuth2 Authorization Server.postman_collection.json](docs/postman/OAuth2%20Authorization%20Server.postman_collection.json)\n    - [OAuth2 Authorization Server.postman_environment.json](docs/postman/OAuth2%20Authorization%20Server.postman_environment.json)\n- Swagger: http://localhost:9000/swagger-ui/index.html\n    - Click `Authorize` and enter the following credentials\n    - `client_id`: `client`\n    - `client_secret`: `secret`\n    - Use one of the following default values to log in http://localhost:9000/login\n        - username: `Developer` password: `password`\n        - username: `Admin` password: `password`\n        - username: `User` password: `password`\n- Actuator: http://localhost:9000/actuator/\n- Database credentials\n    - `url`: `jdbc:mariadb://localhost:3306/oauth2_authorization_server`\n    - `username`: `mb_test`\n    - `password`: `test`\n- Redis\n    - `host`: `localhost`\n    - `port`: `6379`\n- Redis Insight: http://localhost:5540/\n    - Click `Add Redis database`\n    - `Connection URL` --\u003e `redis://default@host.docker.internal:6379`\n    - Click `Add Database`\n    - ![img.png](docs/Redis_Insight_Connection_Details.png)\n- Ollama\n    - http://localhost:3000/ sign up for an account for local environment\n    - Search for `mxbai-embed-large` and download it if it does not exist\n    - Search for `deepseek-r1:7b` and download it if it does not exist\n\n#### Debugging Spring Boot Tests in IntelliJ IDEA\n\n1. Run one of the below commands in the terminal\n    - `mvn test -Dmaven.surefire.debug`\n    - If port 5005 is already in use, you can specify a custom port\n        - `mvn test -Dmaven.surefire.debug=\"-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000\"`\n2. Open IntelliJ IDEA\n3. Go to `Run \u003e Attach to Process` (or use shortcut)\n    - Windows/Linux: `Ctrl + Alt + 5`\n    - Mac: `Cmd + Alt + 5`\n4. Select the Java process running your tests\n5. The test will pause until you connect your debugger. Once connected, you can use breakpoints and step through your\n   code.\n\n#### How to Run and Test Native Image with GraalVM\n\n- Java 24 GraalVM edition should be installed\n- Run `docker-compose up -d` command to run necessary services\n- Run `./mvnw -Pnative native:compile` or `./mvnw -Pnative native:compile -DskipTests` command to build the native image\n- Run `./target/oauth2-authorization-server` command to run the native image\n- Install [Grype](https://github.com/anchore/grype) (OPTIONAL)\n    - Run `native-image-inspect ./target/oauth2-authorization-server-0.0.1 | grype -v` command to scan vulnerabilities\n- Run `native-image-inspect ./target/oauth2-authorization-server-0.0.1 \u003eoutput.json` command and open `output.json` or\n  visit http://localhost:9000/actuator/sbom/native-image to inspect all libraries, methods etc. used in the native image\n- Run `open ./target/oauth2-authorization-server-build-report.html` to see build report\n- Use Swagger UI to test the application\n\n#### Spring Boot with CRaC(Coordinated Restore at Checkpoint) by Creating Ready to Restore Container Image.\n\n- **Warning:** for real projects make sure to not leak sensitive data in CRaC files since they contain a snapshot of the\n  memory of the running JVM instance.\n- **Checkpoint**\n    - Run\n      on [demand checkpoint/restore of a running application](https://docs.spring.io/spring-framework/reference/6.1/integration/checkpoint-restore.html#_on_demand_checkpointrestore_of_a_running_application)\n      with: `./docs/scripts/checkpoint.sh`\n    - Run\n      an [automatic checkpoint/restore at startup](https://docs.spring.io/spring-framework/reference/6.1/integration/checkpoint-restore.html#_automatic_checkpointrestore_at_startup)\n      with: `./docs/scripts/checkpointOnRefresh.sh`\n- **Restore**\n    - Restore the application with: `./docs/scripts/restore.sh`\n- Use Swagger UI to test the application\n\n#### How to Run and Test AI Models Locally with Docker Desktop Model Runner\n\n- Requires: Docker Desktop 4.40 and later\n- Run `docker-compose up -d` command to run necessary services\n- Run `docker model pull ai/gemma3:4B-Q4_K_M` command to pull the model\n    - Run `docker model run ai/gemma3:4B-Q4_K_M` command to run the model to test it from the command line (OPTIONAL)\n- `Docker Desktop` --\u003e `Settings` --\u003e `Features in development` --\u003e `Beta features` --\u003e `Enable Docker Model Runner` --\u003e\n  `Enable host-side TCP support` --\u003e `Apply \u0026 Restart`\n    - ![Docker_Desktop_Enable_Host_Side_TCP_Support.png](docs/Docker_Desktop_Enable_Host_Side_TCP_Support.png)\n- Run `mvn test` or `mvn clean install` or `mvn clean package` or `./mvnw clean install` command to run all the tests\n- Run `mvn spring-boot:run` command to run the application\n- Use Swagger UI to test the application\n\n#### References\n\n- [Spring Boot 3 Tutorial Security OAuth2 Spring Authorization Server Save login data to a database](https://www.youtube.com/watch?v=rVAqh-VDw2o)\n- [Spring Boot LDAP Authentication from scratch with Spring Security and LDAP Server](https://www.youtube.com/watch?v=figTvA-MAZA)\n- [BCryptPasswordEncoderTests](https://github.com/spring-projects/spring-security/blob/main/crypto/src/test/java/org/springframework/security/crypto/bcrypt/BCryptPasswordEncoderTests.java)\n- [Getting started with Spring Boot AOT + GraalVM Native Images](https://www.youtube.com/watch?v=FjRBHKUP-NA)\n    - ![Spring_Boot_AOT_and_GraalVM_Native_Images.png](docs/Spring_Boot_AOT_and_GraalVM_Native_Images.png)\n- [Welcome, GraalVM for JDK 24!🚀](https://medium.com/graalvm/welcome-graalvm-for-jdk-24-7c829fe98ea1)\n- [A vulnerability scanner for container images and filesystems Grype](https://github.com/anchore/grype)\n- [Introduction to Project CRaC: Enhancing Runtime Efficiency in Java \u0026 Spring Development](https://www.youtube.com/watch?v=sVXUx_Y4hRU)\n- [Model Context Protocol (MCP)](https://modelcontextprotocol.io/introduction)\n    - [MCP Server Boot Starter](https://docs.spring.io/spring-ai/reference/api/mcp/mcp-server-boot-starter-docs.html)\n    - [Model Context Protocol (MCP) Explained: How to Give AI Access to Your Files, Web Searches \u0026 More](https://www.youtube.com/watch?v=nNLshWCoe0o)\n    - ![Why_MCP_What_is_MCP_How_Does_MCP_Work.png](docs/Why_MCP_What_is_MCP_How_Does_MCP_Work.png)\n- [Ollama Installation with Docker Compose](https://geshan.com.np/blog/2025/02/ollama-docker-compose/)\n    - [Ollama Chat](https://docs.spring.io/spring-ai/reference/api/chat/ollama-chat.html)\n- [A Guide to Spring AI Advisors](https://www.baeldung.com/spring-ai-advisors)\n- [Testing LLM Responses Using Spring AI Evaluators](https://www.baeldung.com/spring-ai-testing-ai-evaluators)\n- [Vector Databases](https://docs.spring.io/spring-ai/reference/api/vectordbs.html)\n- [Java + RAG: Create an AI-Powered Financial Advisor using Spring AI 💡](https://www.youtube.com/watch?v=6Pgmr7xMjiY)\n    - [Retrieval Augmented Generation (RAG)](https://docs.spring.io/spring-ai/reference/api/retrieval-augmented-generation.html)\n    - ![What_is_Retrieval_Augmented_Generation_(RAG)_What_is_Not_RAG.png](docs/What_is_Retrieval_Augmented_Generation_%28RAG%29_What_is_Not_RAG.png)\n- [Run AI Models Locally: Zero API Keys, Zero Fees with Docker Desktop Model Runner](https://www.youtube.com/watch?v=6E6JFLMHcoQ)\n    - [Docker Model Runner](https://docs.docker.com/desktop/features/model-runner/)\n- [A Step-by-Step Guide for Installing and Using AppMap for Java](https://appmap.io/blog/2021/09/07/mapping-java-applications-tutorial/)\n    - [AppMap Maven plugin](https://appmap.io/docs/reference/appmap-maven-plugin)\n    - [AppMap: Free AI Architect IntelliJ Plugin](https://plugins.jetbrains.com/plugin/16701-appmap-free-ai-architect)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmusabbozkurt%2Foauth2-authorization-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmusabbozkurt%2Foauth2-authorization-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmusabbozkurt%2Foauth2-authorization-server/lists"}