oAuth2 authorization works in two stages:
- The user is authenticated using his credentials.
- The user grants app X permission to use his data.
Step 2 occurs in / oauth / authorize, and step 1 occurs elsewhere in your application (most likely, through the login form, under the protection of Spring).
If you do not protect / oauth / authorize, you end up providing authorization without user authentication (or you wonโt, because without an authenticated session, you probably donโt know who the user is).
source share