Spring Boot Oauth2 Client — Client Credentials Grant
3 min readJul 18, 2020
If you are not a medium member yet, please use the link here to access it for free
Agenda
Spring 5.0, had introduced huge changes(major one was supporting reactive programming) and part of it was re-writing the Oauth2 Client to support the reactive paradigm.
And I would love to share knowledge around the same. In this article I will focus on the Oauth2 Client part only.
Prerequisites
- Knowledge of Spring Boot, Java.
- Good understanding of the Oauth2 Concepts.
- Some understanding of the reactive programming
- JDK 11 installed(tried using JDK 11 only). Though JDK 8 should also work.
- Authorization Server setup is out of context.
- Resource server is out of context but can be referred from previous article here
Some pros about the spring boot oauth2 client.
- It will fetch the access token for you before fetching the actual resource
- It will cache the access token until the expiry and will re fetch the new token after existing token has expired