-
Notifications
You must be signed in to change notification settings - Fork 2.7k
[msal-v5] Add accountSource when caching an account #8215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: msal-v5
Are you sure you want to change the base?
Conversation
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request introduces comprehensive documentation and structural improvements to support the Native Authentication (Custom Auth) feature in MSAL.js v5, along with significant architectural refactoring to modernize the codebase.
Key Changes:
- Added detailed Copilot instructions and coding guidelines for the new Custom Auth feature
- Implemented complete Custom Auth public API with configuration, constants, and action inputs
- Refactored core controllers and cache management to remove deprecated APIs and improve performance tracking
- Updated cryptography operations to include correlation IDs for better telemetry
- Modernized browser cache management with encryption support and schema versioning
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/msal-browser/src/custom_auth/CustomAuthConfiguration.ts | Defines configuration types for Custom Auth feature |
| lib/msal-browser/src/custom_auth/UserAccountAttributes.ts | Defines user account attribute types for Custom Auth |
| lib/msal-browser/src/custom_auth/ICustomAuthPublicClientApplication.ts | Interface defining Custom Auth public API methods |
| lib/msal-browser/src/custom_auth/CustomAuthPublicClientApplication.ts | Main entry point implementation for Custom Auth |
| lib/msal-browser/src/custom_auth/CustomAuthConstants.ts | Constants and enums for Custom Auth feature |
| lib/msal-browser/src/custom_auth/CustomAuthActionInputs.ts | Input type definitions for Custom Auth actions |
| lib/msal-browser/src/crypto/SignedHttpRequest.ts | Updated to include correlation IDs and StubPerformanceClient |
| lib/msal-browser/src/crypto/PkceGenerator.ts | Refactored to use browser-specific performance events |
| lib/msal-browser/src/crypto/CryptoOps.ts | Updated to include correlation IDs throughout |
| lib/msal-browser/src/crypto/BrowserCrypto.ts | Simplified sha256Digest signature |
| lib/msal-browser/src/controllers/StandardController.ts | Major refactor adding accountSource tracking and updating event handling |
| lib/msal-browser/src/controllers/NestedAppAuthController.ts | Updated to add accountSource "naa" when caching accounts |
| lib/msal-browser/src/cache/TokenCache.ts | Refactored from class to standalone functions with accountSource support |
| lib/msal-browser/src/cache/BrowserCacheManager.ts | Extensive updates for cache migration, encryption, and accountSource tracking |
| result.account, | ||
| { | ||
| ...result.account, | ||
| accountSource: "pwb", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use API names or a number tag, we can't assume this is a PWB call
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest using ApiId actually
This pull request introduces significant documentation and configuration updates to improve clarity, onboarding, and maintainability for the MSAL.js repository, with a particular focus on the new Native Authentication (Custom Auth) feature. The changes include detailed architectural and code structure guides, usage patterns, and contribution instructions, as well as updates to project configuration files.
Documentation Additions and Improvements:
.github/copilot-instructions.md) describing repository structure, package dependencies, review guidelines, and best practices for documentation, testing, telemetry, and changefile management..github/instructions/custom_auth_product.instructions.md)..github/instructions/custom_auth_structure.instructions.md)..github/instructions/changefiles.instructions.md).Configuration Updates:
.beachballrcfromdevtomsal-v5to align with current development practices.Minor Template Update:
storeAuthStateInCookieproperty from the bug report issue template YAML.