How do /oauth/authorize and /oauth/token interact in Spring OAuth? How do /oauth/authorize and /oauth/token interact in Spring OAuth? spring spring

How do /oauth/authorize and /oauth/token interact in Spring OAuth?


Per the OAuth 2.0 specification the authorize and token endpoints have different purposes.

Authorization endpoint is where the resource owner (user) logs in and grants authorization to the client (ex: web application running in the browser or an app running on a mobile device). This is typically used in scenarios where the resource owner's user agent (ex: browser) is redirected to the identity server (authorization server) for authentication. The resource owner's user agent will have direct access to the access token.

Token endpoint is where the client (ex: Server side API or mobile app) calls to exchange the Authorization Code, Client Id and Client Secret for an access token. In this scenario, the user agent is provided with an Authorization code only, no direct access to the access token. The client is a trusted party with access to client Id and Client secret from the authorization server (That is why I mentioned Server side API as the client).

Please read this article that has even better explanation.