Example for setting up a OAuth 2 Resource Server on a web service with Spring Boot. Using Keycloak as the OAuth server.
The project requires an authorization server. The Docker compose file will take care of this, while also running the project:
docker-compose -f docker/docker-compose.yml --project-name oauth2-resource-server-example up
Once started, the web service be available at http://localhost:8080/.
To make things easier import src/test/resources/resource_server.postman_collection.json
into Postman. This file includes all the queries needed to test the project.
User | Password | Permissions |
---|---|---|
test-user | 1234 | read, edit |
Note that this web service requires secure tokens. The Postman requests includes an authenticated one, which takes care of this.
- Spring MVC
- OAuth2
- Integrates with Keycloak
- Basic Spring Boot security auditing
Documentation is always generated for the latest release, kept in the 'master' branch:
Documentation is also generated from the latest snapshot, taken from the 'develop' branch:
The documentation site is actually a Maven site, and its sources are included in the project. If required it can be generated by using the following Maven command:
mvn verify site
The verify phase is required, otherwise some of the reports won't be generated.
Any kind of help with the project will be well received, and there are two main ways to give such help:
- Reporting errors and asking for extensions through the issues management
- or forking the repository and extending the project
Issues are managed at the GitHub project issues tracker, where any Github user may report bugs or ask for new features.
If you wish to fork or modify the code, visit the GitHub project page, where the latest versions are always kept. Check the 'master' branch for the latest release, and the 'develop' for the current, and stable, development version.
The project has been released under the MIT License.