-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Description
Summary
Not sure if this would be considered a bug or feature request, however it is causing issues trying to authenticate with an oauth2 server.
When using the oauth2-client, it's not possible to set the User-Agent for the requests made to authenticate and retrieve the user info. This causes issues for some oauth2 servers - specifically those behind Cloudflare, which blocks requests without a user-agent.
The specific server I'm having trouble with is Discord.
If I replace NimbusAuthorizationCodeTokenResponseClient.java
and NimbusUserInfoResponseClient.java
to add a User-Agent header in the requests, everything works as expected. (Any user agent works, as long as it's not blank).
Actual Behavior
Without overriding the classess to add a User-Agent, I get a 403 for both of those requests.
Expected Behavior
I am able to complete the oauth2-client flow.
Configuration
I'm using Spring Boot 2.0 (latest snapshot) Autoconfiguration.
Version
Spring Security 5, specifically for oauth2-client.