Not sure about Spring’s ServerOAuth2AuthorizedClientExchangeFilterFunction
, but in case it helps (or if you have no other choice ) you can use
auth0-java
’s requestToken
method to get a token: GitHub - auth0/auth0-java: Java client library for the Auth0 platform
AuthAPI auth = new AuthAPI("{YOUR_DOMAIN}", "{YOUR_CLIENT_ID}", "{YOUR_CLIENT_SECRET}");
AuthRequest request = auth.requestToken("https://{YOUR_DOMAIN}/api/v2/");
try {
TokenHolder holder = request.execute();
} catch (APIException exception) {
// api error
} catch (Auth0Exception exception) {
// request error
}