Resource Server should identify unauthorized REST requests like HTTP Basic does #9100
Labels
in: oauth2
An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose)
type: enhancement
A general enhancement
Milestone
When a web application is configured for a browser-based authentication mechanism in addition to Resource Server, empty unauthenticated requests default to the browser-based mechanism.
For example, if an application does
And then a REST request is made like so:
Then the response will be a 302 instead of a 401.
The reason is because
OAuth2ResourceServerConfigurer
registers itsAuthenticationEntryPoint
only with the condition that the request contains anAuthorization
header. Because the above request has noAuthorization
header, Resource Server's entry point isn't activated.HttpBasicConfigurer
registers itsAuthenticationEntryPoint
with a condition that the request not appear to be a browser-based request. Thus, it's activated when there's a badAuthorization
header, but also when it appears to be a REST request.OAuth2ResourceServerConfigurer
should adopt the strategy employed byHttpBasicConfigurer
so that requests like:result in a 401 instead of a 302.
The text was updated successfully, but these errors were encountered: