loginRedirect() returns 302 Status and no redirection happens #7452
Labels
bug-unconfirmed
A reported bug that needs to be investigated and confirmed
msal-browser
Related to msal-browser package
Needs: Attention 👋
Awaiting response from the MSAL.js team
public-client
Issues regarding PublicClientApplications
question
Customer is asking for a clarification, use case or information.
Core Library
MSAL.js (@azure/msal-browser)
Core Library Version
2.35.0
Wrapper Library
Not Applicable
Wrapper Library Version
None
Public or Confidential Client?
Public
Description
Hello,
I am developing Flutter Web App that utilises msal in authentication flow. I managed to implement the auth flow and it works fine in most cases but there are some issues with specific scenarios especially on Edge browser. When loginRedirect() is called on Edge and the user is logged in the browser then the user ends up in login loop. loginRedirect() calls https://#.microsoftonline.com/{tenantId} with all the necessary parameters but nothing happens. In network calls I can see that sometimes the request is all in red without any status or 302 status is returned with the location in header exactly the same as the one it was called with. As I mentioned before for other cases it works fine as well as on incognito mode on Edge Browser. Using promt=login does not change anything.
Error Message
No response
MSAL Logs
MSAL: [LogLevel.verbose] [Fri, 06 Dec 2024 12:38:52 GMT] : @azure/msal-browser@2.35.0 : Verbose - getAllAccounts called
main.dart.js:41789 MSAL: [LogLevel.verbose] [Fri, 06 Dec 2024 12:38:52 GMT] : @azure/msal-browser@2.35.0 : Verbose - BrowserCacheManager.getAccountKeys - No account keys found
main.dart.js:41789 MSAL: [LogLevel.verbose] [Fri, 06 Dec 2024 12:38:52 GMT] : @azure/msal-browser@2.35.0 : Verbose - getAllAccounts called
main.dart.js:41789 MSAL: [LogLevel.verbose] [Fri, 06 Dec 2024 12:38:52 GMT] : @azure/msal-browser@2.35.0 : Verbose - BrowserCacheManager.getAccountKeys - No account keys found
main.dart.js:41789 MSAL: [LogLevel.verbose] [Fri, 06 Dec 2024 12:38:52 GMT] : [abcc3d0e-dbf0-48d2-acd6-b1b4e5e9301b] : @azure/msal-browser@2.35.0 : Verbose - loginRedirect called
main.dart.js:41789 MSAL: [LogLevel.verbose] [Fri, 06 Dec 2024 12:38:52 GMT] : [abcc3d0e-dbf0-48d2-acd6-b1b4e5e9301b] : @azure/msal-browser@2.35.0 : Verbose - acquireTokenRedirect called
main.dart.js:41789 MSAL: [LogLevel.verbose] [Fri, 06 Dec 2024 12:38:52 GMT] : @azure/msal-browser@2.35.0 : Verbose - preflightBrowserEnvironmentCheck started
main.dart.js:41789 MSAL: [LogLevel.verbose] [Fri, 06 Dec 2024 12:38:52 GMT] : @azure/msal-browser@2.35.0 : Verbose - preflightInteractiveRequest called, validating app environment
main.dart.js:41789 MSAL: [LogLevel.verbose] [Fri, 06 Dec 2024 12:38:52 GMT] : @azure/msal-browser@2.35.0 : Verbose - getAllAccounts called
main.dart.js:41789 MSAL: [LogLevel.verbose] [Fri, 06 Dec 2024 12:38:52 GMT] : @azure/msal-browser@2.35.0 : Verbose - BrowserCacheManager.getAccountKeys - No account keys found
main.dart.js:41789 MSAL: [LogLevel.info] [Fri, 06 Dec 2024 12:38:52 GMT] : @azure/msal-browser@2.35.0 : Info - Emitting event: msal:loginStart
main.dart.js:41789 MSAL: [LogLevel.verbose] [Fri, 06 Dec 2024 12:38:52 GMT] : [abcc3d0e-dbf0-48d2-acd6-b1b4e5e9301b] : msal.js.browser@2.35.0 : Verbose - initializeAuthorizationRequest called
main.dart.js:41789 MSAL: [LogLevel.verbose] [Fri, 06 Dec 2024 12:38:52 GMT] : [abcc3d0e-dbf0-48d2-acd6-b1b4e5e9301b] : msal.js.browser@2.35.0 : Verbose - getRedirectUri called
main.dart.js:41789 MSAL: [LogLevel.verbose] [Fri, 06 Dec 2024 12:38:52 GMT] : [abcc3d0e-dbf0-48d2-acd6-b1b4e5e9301b] : msal.js.browser@2.35.0 : Verbose - Initializing BaseAuthRequest
main.dart.js:41789 MSAL: [LogLevel.verbose] [Fri, 06 Dec 2024 12:38:52 GMT] : [abcc3d0e-dbf0-48d2-acd6-b1b4e5e9301b] : msal.js.browser@2.35.0 : Verbose - Authentication Scheme wasn't explicitly set in request, defaulting to "Bearer" request
main.dart.js:41789 MSAL: [LogLevel.verbose] [Fri, 06 Dec 2024 12:38:52 GMT] : [abcc3d0e-dbf0-48d2-acd6-b1b4e5e9301b] : msal.js.browser@2.35.0 : Verbose - initializeServerTelemetryManager called
main.dart.js:41789 MSAL: [LogLevel.verbose] [Fri, 06 Dec 2024 12:38:52 GMT] : [abcc3d0e-dbf0-48d2-acd6-b1b4e5e9301b] : msal.js.browser@2.35.0 : Verbose - initializeAuthorizationRequest called
main.dart.js:41789 MSAL: [LogLevel.verbose] [Fri, 06 Dec 2024 12:38:52 GMT] : [abcc3d0e-dbf0-48d2-acd6-b1b4e5e9301b] : msal.js.browser@2.35.0 : Verbose - getClientConfiguration called
main.dart.js:41789 MSAL: [LogLevel.verbose] [Fri, 06 Dec 2024 12:38:52 GMT] : [abcc3d0e-dbf0-48d2-acd6-b1b4e5e9301b] : msal.js.browser@2.35.0 : Verbose - getDiscoveredAuthority called
main.dart.js:41789 MSAL: [LogLevel.verbose] [Fri, 06 Dec 2024 12:38:52 GMT] : [abcc3d0e-dbf0-48d2-acd6-b1b4e5e9301b] : msal.js.browser@2.35.0 : Verbose - Creating discovered authority with configured authority
main.dart.js:41789 MSAL: [LogLevel.verbose] [Fri, 06 Dec 2024 12:38:52 GMT] : [abcc3d0e-dbf0-48d2-acd6-b1b4e5e9301b] : msal.js.browser@2.35.0 : Verbose - Attempting to get cloud discovery metadata in the config
main.dart.js:41789 MSAL: [LogLevel.verbose] [Fri, 06 Dec 2024 12:38:52 GMT] : [abcc3d0e-dbf0-48d2-acd6-b1b4e5e9301b] : msal.js.browser@2.35.0 : Verbose - Did not find cloud discovery metadata in the config... Attempting to get cloud discovery metadata from the cache.
main.dart.js:41789 MSAL: [LogLevel.verbose] [Fri, 06 Dec 2024 12:38:52 GMT] : [abcc3d0e-dbf0-48d2-acd6-b1b4e5e9301b] : msal.js.browser@2.35.0 : Verbose - Did not find cloud discovery metadata in the cache... Attempting to get cloud discovery metadata from the network.
main.dart.js:41789 MSAL: [LogLevel.verbose] [Fri, 06 Dec 2024 12:38:53 GMT] : [abcc3d0e-dbf0-48d2-acd6-b1b4e5e9301b] : msal.js.browser@2.35.0 : Verbose - Attempting to find a match between the developer's authority and the CloudInstanceDiscoveryMetadata returned from the network request.
main.dart.js:41789 MSAL: [LogLevel.verbose] [Fri, 06 Dec 2024 12:38:53 GMT] : [abcc3d0e-dbf0-48d2-acd6-b1b4e5e9301b] : msal.js.browser@2.35.0 : Verbose - cloud discovery metadata was successfully returned from getCloudDiscoveryMetadataFromNetwork()
main.dart.js:41789 MSAL: [LogLevel.verbose] [Fri, 06 Dec 2024 12:38:53 GMT] : [abcc3d0e-dbf0-48d2-acd6-b1b4e5e9301b] : @azure/msal-browser@2.35.0 : Verbose - PerformanceClient: Emitting performance events
main.dart.js:41789 MSAL: [LogLevel.verbose] [Fri, 06 Dec 2024 12:38:53 GMT] : [abcc3d0e-dbf0-48d2-acd6-b1b4e5e9301b] : msal.js.browser@2.35.0 : Verbose - Auth code client created
main.dart.js:41789 MSAL: [LogLevel.verbose] [Fri, 06 Dec 2024 12:38:53 GMT] : [abcc3d0e-dbf0-48d2-acd6-b1b4e5e9301b] : @azure/msal-common@12.0.0 : Verbose - createAuthCodeUrlQueryString: No account, adding login_hint from request
main.dart.js:41789 MSAL: [LogLevel.verbose] [Fri, 06 Dec 2024 12:38:53 GMT] : [abcc3d0e-dbf0-48d2-acd6-b1b4e5e9301b] : msal.js.browser@2.35.0 : Verbose - RedirectHandler.initiateAuthRequest called
main.dart.js:41789 MSAL: [LogLevel.verbose] [Fri, 06 Dec 2024 12:38:53 GMT] : [abcc3d0e-dbf0-48d2-acd6-b1b4e5e9301b] : msal.js.browser@2.35.0 : Verbose - RedirectHandler.initiateAuthRequest: redirectStartPage set, caching start page
main.dart.js:41789 MSAL: [LogLevel.verbose] [Fri, 06 Dec 2024 12:38:53 GMT] : [abcc3d0e-dbf0-48d2-acd6-b1b4e5e9301b] : msal.js.browser@2.35.0 : Verbose - RedirectHandler.initiateAuthRequest: Invoking onRedirectNavigate callback
main.dart.js:41789 https://#.microsoftonline.com/
main.dart.js:41789 MSAL: [LogLevel.verbose] [Fri, 06 Dec 2024 12:38:53 GMT] : [abcc3d0e-dbf0-48d2-acd6-b1b4e5e9301b] : msal.js.browser@2.35.0 : Verbose - RedirectHandler.initiateAuthRequest: onRedirectNavigate did not return false, navigating
is deprecated. Please include
main.dart.js:41789 MSAL: [LogLevel.verbose] [Fri, 06 Dec 2024 12:38:55 GMT] : @azure/msal-browser@2.35.0 : Verbose - BrowserCrypto: modern crypto interface available
main.dart.js:41789 MSAL: [LogLevel.verbose] [Fri, 06 Dec 2024 12:38:55 GMT] : @azure/msal-browser@2.35.0 : Verbose - BrowserCrypto: modern crypto interface available
main.dart.js:41789 MSAL: [LogLevel.verbose] [Fri, 06 Dec 2024 12:38:55 GMT] : @azure/msal-browser@2.35.0 : Verbose - handleRedirectPromise called
main.dart.js:41789 MSAL: [LogLevel.verbose] [Fri, 06 Dec 2024 12:38:55 GMT] : @azure/msal-browser@2.35.0 : Verbose - getAllAccounts called
main.dart.js:41789 MSAL: [LogLevel.verbose] [Fri, 06 Dec 2024 12:38:55 GMT] : @azure/msal-browser@2.35.0 : Verbose - BrowserCacheManager.getAccountKeys - No account keys found
main.dart.js:41789 MSAL: [LogLevel.info] [Fri, 06 Dec 2024 12:38:55 GMT] : @azure/msal-browser@2.35.0 : Info - Emitting event: msal:handleRedirectStart
main.dart.js:41789 MSAL: [LogLevel.verbose] [Fri, 06 Dec 2024 12:38:55 GMT] : @azure/msal-browser@2.35.0 : Verbose - handleRedirectPromise has been called for the first time, storing the promise
main.dart.js:41789 MSAL: [LogLevel.verbose] [Fri, 06 Dec 2024 12:38:55 GMT] : [abcc3d0e-dbf0-48d2-acd6-b1b4e5e9301b] : msal.js.browser@2.35.0 : Verbose - initializeServerTelemetryManager called
main.dart.js:41789 MSAL: [LogLevel.verbose] [Fri, 06 Dec 2024 12:38:55 GMT] : [abcc3d0e-dbf0-48d2-acd6-b1b4e5e9301b] : msal.js.browser@2.35.0 : Verbose - getRedirectResponseHash called
main.dart.js:41789 MSAL: [LogLevel.verbose] [Fri, 06 Dec 2024 12:38:55 GMT] : [abcc3d0e-dbf0-48d2-acd6-b1b4e5e9301b] : msal.js.browser@2.35.0 : Verbose - Hash does not contain known properties, returning cached hash
main.dart.js:41789 MSAL: [LogLevel.info] [Fri, 06 Dec 2024 12:38:55 GMT] : [abcc3d0e-dbf0-48d2-acd6-b1b4e5e9301b] : msal.js.browser@2.35.0 : Info - handleRedirectPromise did not detect a response hash as a result of a redirect. Cleaning temporary cache.
main.dart.js:41789 MSAL: [LogLevel.info] [Fri, 06 Dec 2024 12:38:55 GMT] : @azure/msal-browser@2.35.0 : Info - Emitting event: msal:handleRedirectEnd
main.dart.js:41789 MSAL: [LogLevel.verbose] [Fri, 06 Dec 2024 12:38:55 GMT] : @azure/msal-browser@2.35.0 : Verbose - getAllAccounts called
main.dart.js:41789 MSAL: [LogLevel.verbose] [Fri, 06 Dec 2024 12:38:55 GMT] : @azure/msal-browser@2.35.0 : Verbose - BrowserCacheManager.getAccountKeys - No account keys found
main.dart.js:41789 MSAL: [LogLevel.verbose] [Fri, 06 Dec 2024 12:38:55 GMT] : @azure/msal-browser@2.35.0 : Verbose - getAllAccounts called
main.dart.js:41789 MSAL: [LogLevel.verbose] [Fri, 06 Dec 2024 12:38:55 GMT] : @azure/msal-browser@2.35.0 : Verbose - BrowserCacheManager.getAccountKeys - No account keys found
main.dart.js:41789 MSAL: [LogLevel.verbose] [Fri, 06 Dec 2024 12:38:55 GMT] : @azure/msal-browser@2.35.0 : Verbose - getAllAccounts called
main.dart.js:41789 MSAL: [LogLevel.verbose] [Fri, 06 Dec 2024 12:38:55 GMT] : @azure/msal-browser@2.35.0 : Verbose - BrowserCacheManager.getAccountKeys - No account keys found
main.dart.js:41789 MSAL: [LogLevel.verbose] [Fri, 06 Dec 2024 12:38:55 GMT] : @azure/msal-browser@2.35.0 : Verbose - BrowserCrypto: modern crypto interface available
main.dart.js:41789 MSAL: [LogLevel.verbose] [Fri, 06 Dec 2024 12:38:55 GMT] : @azure/msal-browser@2.35.0 : Verbose - BrowserCrypto: modern crypto interface available
main.dart.js:41789 MSAL: [LogLevel.verbose] [Fri, 06 Dec 2024 12:38:55 GMT] : @azure/msal-browser@2.35.0 : Verbose - getAllAccounts called
main.dart.js:41789 MSAL: [LogLevel.verbose] [Fri, 06 Dec 2024 12:38:55 GMT] : @azure/msal-browser@2.35.0 : Verbose - BrowserCacheManager.getAccountKeys - No account keys found
main.dart.js:41789 MSAL: [LogLevel.verbose] [Fri, 06 Dec 2024 12:38:55 GMT] : @azure/msal-browser@2.35.0 : Verbose - getAllAccounts called
main.dart.js:41789 MSAL: [LogLevel.verbose] [Fri, 06 Dec 2024 12:38:55 GMT] : @azure/msal-browser@2.35.0 : Verbose - BrowserCacheManager.getAccountKeys - No account keys found
main.dart.js:41789 MSAL: [LogLevel.verbose] [Fri, 06 Dec 2024 12:38:56 GMT] : @azure/msal-browser@2.35.0 : Verbose - getAllAccounts called
main.dart.js:41789 MSAL: [LogLevel.verbose] [Fri, 06 Dec 2024 12:38:56 GMT] : @azure/msal-browser@2.35.0 : Verbose - BrowserCacheManager.getAccountKeys - No account keys found
main.dart.js:41789 MSAL: [LogLevel.verbose] [Fri, 06 Dec 2024 12:38:57 GMT] : @azure/msal-browser@2.35.0 : Verbose - getAllAccounts called
main.dart.js:41789 MSAL: [LogLevel.verbose] [Fri, 06 Dec 2024 12:38:57 GMT] : @azure/msal-browser@2.35.0 : Verbose - BrowserCacheManager.getAccountKeys - No account keys found
Network Trace (Preferrably Fiddler)
MSAL Configuration
Relevant Code Snippets
Reproduction Steps
Expected Behavior
Triggering loginRedirect() always show the Microsoft Login Page.
Identity Provider
Entra ID (formerly Azure AD) / MSA
Browsers Affected (Select all that apply)
Chrome, Edge
Regression
No response
The text was updated successfully, but these errors were encountered: