Skip to content

Commit 919a7b4

Browse files
Copilottnorling
andauthored
[Documentation] Add missing "Implicit Flow vs Authorization Code Flow with PKCE" section to MSAL Browser README (#7903)
This PR fixes a missing documentation section in the MSAL Browser README that was referenced in the table of contents but didn't exist in the document. ## Issue The MSAL Browser README.md had: - A table of contents entry for "Authorization Code vs Implicit" linking to `#implicit-flow-vs-authorization-code-flow-with-pkce` - An inline reference in the "About" section pointing to the same anchor - But no actual section with that heading existed, causing broken links ## Solution Added the missing section "## Implicit Flow vs Authorization Code Flow with PKCE" that includes: ### Content Added - **Authorization Code Flow with PKCE explanation**: Details about the current OAuth 2.0 flow used by MSAL.js 2.x and its security benefits - **Implicit Flow (Deprecated) explanation**: Information about the previous flow used in MSAL.js 1.x and why it's deprecated - **Migration Considerations**: Guidance for developers migrating from v1.x to v2.x - **References to additional documentation**: Links to migration guides and Microsoft identity platform docs ### Section Structure ```markdown ## Implicit Flow vs Authorization Code Flow with PKCE ### Authorization Code Flow with PKCE - Enhanced Security - No Tokens in URLs - Refresh Token Support - OIDC Compliance ### Implicit Flow (Deprecated) - Security concerns outlined - Reasons for deprecation ### Migration Considerations - Configuration requirements - Migration guidance ``` The section is properly positioned between "Build and Test" and "Framework Wrappers" as indicated by the table of contents order. Fixes #7347. <!-- START COPILOT CODING AGENT TIPS --> --- 💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more [Copilot coding agent tips](https://gh.io/copilot-coding-agent-tips) in the docs. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: tnorling <5307810+tnorling@users.noreply.github.com> Co-authored-by: Thomas Norling <thomas.norling@microsoft.com>
1 parent 7f86b69 commit 919a7b4

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

lib/msal-browser/README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,36 @@ npm test
132132
npm run test:coverage
133133
```
134134

135+
## Implicit Flow vs Authorization Code Flow with PKCE
136+
137+
`@azure/msal-browser` implements the [OAuth 2.0 Authorization Code Flow with PKCE](https://tools.ietf.org/html/rfc7636) for browser-based applications. This is a significant improvement over the Implicit Flow that was used in `@azure/msal`, `msal` or `adal-angular`.
138+
139+
### Authorization Code Flow with PKCE
140+
141+
The Authorization Code Flow with Proof Key for Code Exchange (PKCE) is the current industry standard for securing OAuth 2.0 authorization in public clients, including single-page applications (SPAs). Key benefits include:
142+
143+
- **Enhanced Security**: PKCE provides protection against authorization code interception attacks
144+
- **No Tokens in URLs**: Tokens are never exposed in the browser's URL or history
145+
- **Refresh Token Support**: Enables long-lived sessions through refresh tokens
146+
- **OIDC Compliance**: Fully compliant with OpenID Connect standards
147+
148+
### Implicit Flow (Deprecated)
149+
150+
The Implicit Flow was the previous standard for SPAs but has been deprecated due to security concerns:
151+
152+
- **Tokens in URLs**: Access tokens are returned in URL fragments, making them visible in browser history and server logs
153+
- **No Refresh Tokens**: Implicit flow cannot securely deliver refresh tokens to public clients
154+
- **Increased Attack Surface**: Tokens are more susceptible to token leakage attacks
155+
156+
### Migration Considerations
157+
158+
- **`@azure/msal-browser` only supports Authorization Code Flow with PKCE** - Implicit Flow is not supported
159+
- If you're migrating from `@azure/msal`, `msal` or `adal-angular`, see our [migration guide](./docs/v1-migration.md)
160+
- Your Azure AD app registration needs to be configured for the Authorization Code Flow
161+
- Existing applications using Implicit Flow should migrate to Authorization Code Flow for improved security
162+
163+
For more technical details about these flows, refer to the [Microsoft identity platform documentation](https://docs.microsoft.com/azure/active-directory/develop/v2-oauth2-auth-code-flow).
164+
135165
## Framework Wrappers
136166

137167
If you are using a framework such as Angular or React you may be interested in using one of our wrapper libraries:

0 commit comments

Comments
 (0)