fix: msal-react passes undefined to ssoSilent when no request provided#8520
Open
lalimasharda wants to merge 5 commits intodevfrom
Open
fix: msal-react passes undefined to ssoSilent when no request provided#8520lalimasharda wants to merge 5 commits intodevfrom
lalimasharda wants to merge 5 commits intodevfrom
Conversation
…tion-library-for-js into bugfix/msal-react-ssoSilent
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a bug in MSAL React where InteractionType.Silent could end up calling instance.ssoSilent(undefined) when no authenticationRequest is provided, preventing the silent authentication flow from starting (issue #8382). It also includes a small cleanup in MSAL Browser around ssoSilent request construction.
Changes:
- Update
useMsalAuthenticationto pass{}(instead ofundefined) tossoSilentwhen no request is provided. - Update the
MsalAuthenticationTemplatetest to expect an empty object for thessoSilentrequest. - Remove redundant
promptassignment/comment inmsal-browserStandardController.ssoSilentrequest normalization.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| lib/msal-react/src/hooks/useMsalAuthentication.ts | Ensures ssoSilent is always invoked with a defined request object ({} fallback). |
| lib/msal-react/test/components/MsalAuthenticationTemplate.spec.tsx | Aligns test expectations with the new {} fallback behavior. |
| lib/msal-browser/src/controllers/StandardController.ts | Removes redundant prompt property assignment when building validRequest. |
Agent-Logs-Url: https://github.com/AzureAD/microsoft-authentication-library-for-js/sessions/268ad72d-cdcb-47ee-9056-eb5b46e44ee1 Co-authored-by: lalimasharda <26092202+lalimasharda@users.noreply.github.com>
Copilot
AI
changed the title
fix msal-react passing in undefined ssoSilent request
fix: msal-react passes undefined to ssoSilent when no request provided
Apr 8, 2026
lalimasharda
commented
Apr 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When
useMsalAuthenticationis used withInteractionType.Silentand noauthenticationRequest,instance.ssoSilent(undefined)was called, causing the silent flow to fail (issue #8382).Changes
useMsalAuthentication: Fall back to{}instead ofundefinedwhen nologinRequestis available, sossoSilentalways receives a valid request objectMsalAuthenticationTemplate.spec.tsx: Updated test expectation to match the new{}fallbackStandardController: Removed redundantpromptassignment fromvalidRequestconstruction (already covered by the spread)hooks.md: Updated Silent interaction type note — request is now optional (empty object used as fallback), though providingloginHint,sid, oraccountis still strongly recommended