Full Stackhard
Can you explain the OAuth 2.0 authorization code flow and its benefits?
Detail the OAuth 2.0 authorization code grant type. Discuss how it works and why it is preferred for security-sensitive applications.
Asked at Stripe, Uber, Netflix
Answer
- The flow involves the user being redirected to the authorization server to grant access.
- The authorization server provides an authorization code back to the application.
- The application exchanges the code for an access token at the token endpoint.
- This flow is secure as the access token is not exposed to the user agent (browser).
- It allows for refreshing access tokens without requiring user re-authentication.