Trouble getting accessToken from acquireTokenInteractive in packaged Electron app #7306
Open
1 of 2 tasks
Labels
bug-unconfirmed
A reported bug that needs to be investigated and confirmed
msal-node
Related to msal-node 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 Node (@azure/msal-node)
Core Library Version
2.13.0
Wrapper Library
Not Applicable
Wrapper Library Version
None
Public or Confidential Client?
Public
Description
When packaging Electron apps, either the ElectronSystemBrowserTestApp or a custom one, we can't get the access token back from the interactive sign in. The success template is displayed in the browser and the user is redirected back to the app, but we never get the accessToken/authResponse back.
This however, works fine in the example app and our own app.
Error Message
No errors are thrown.
MSAL Logs
[2024-09-11 10:43:33.828] [info] [Wed, 11 Sep 2024 08:43:33 GMT] : [] : @azure/[email protected] : Info - getTokenCache called
[2024-09-11 10:43:33.836] [info] [Wed, 11 Sep 2024 08:43:33 GMT] : [] : @azure/[email protected] : Info - getAuthCodeUrl called
[2024-09-11 10:43:33.836] [info] [Wed, 11 Sep 2024 08:43:33 GMT] : [] : @azure/[email protected] : Verbose - initializeRequestScopes called
[2024-09-11 10:43:33.837] [info] [Wed, 11 Sep 2024 08:43:33 GMT] : [ebebc577-14e1-43b7-965e-ed097641119b] : @azure/[email protected] : Verbose - buildOauthClientConfiguration called
[2024-09-11 10:43:33.837] [info] [Wed, 11 Sep 2024 08:43:33 GMT] : [ebebc577-14e1-43b7-965e-ed097641119b] : @azure/[email protected] : Verbose - createAuthority called
[2024-09-11 10:43:33.838] [info] [Wed, 11 Sep 2024 08:43:33 GMT] : [] : @azure/[email protected] : Verbose - Attempting to get cloud discovery metadata from authority configuration
[2024-09-11 10:43:33.838] [info] [Wed, 11 Sep 2024 08:43:33 GMT] : [] : @azure/[email protected] : Verbose - Known Authorities:
[2024-09-11 10:43:33.838] [info] [Wed, 11 Sep 2024 08:43:33 GMT] : [] : @azure/[email protected] : Verbose - Authority Metadata: N/A
[2024-09-11 10:43:33.838] [info] [Wed, 11 Sep 2024 08:43:33 GMT] : [] : @azure/[email protected] : Verbose - Canonical Authority: https://login.microsoftonline.com/c3af1697-15c2-44e3-99ae-9f34166c36fb/
[2024-09-11 10:43:33.839] [info] [Wed, 11 Sep 2024 08:43:33 GMT] : [] : @azure/[email protected] : Verbose - Did not find cloud discovery metadata in the config... Attempting to get cloud discovery metadata from the hardcoded values.
[2024-09-11 10:43:33.839] [info] [Wed, 11 Sep 2024 08:43:33 GMT] : [] : @azure/[email protected] : Verbose - Found cloud discovery metadata from hardcoded values.
[2024-09-11 10:43:33.839] [info] [Wed, 11 Sep 2024 08:43:33 GMT] : [] : @azure/[email protected] : Verbose - Attempting to get endpoint metadata from authority configuration
[2024-09-11 10:43:33.839] [info] [Wed, 11 Sep 2024 08:43:33 GMT] : [] : @azure/[email protected] : Verbose - Did not find endpoint metadata in the config... Attempting to get endpoint metadata from the hardcoded values.
[2024-09-11 10:43:33.839] [info] [Wed, 11 Sep 2024 08:43:33 GMT] : [] : @azure/[email protected] : Verbose - Replacing tenant domain name c3af1697-15c2-44e3-99ae-9f34166c36fb with id {tenantid}
[2024-09-11 10:43:33.840] [info] [Wed, 11 Sep 2024 08:43:33 GMT] : [ebebc577-14e1-43b7-965e-ed097641119b] : @azure/[email protected] : Info - Building oauth client configuration with the following authority: https://login.microsoftonline.com/c3af1697-15c2-44e3-99ae-9f34166c36fb/oauth2/v2.0/token.
[2024-09-11 10:43:33.840] [info] [Wed, 11 Sep 2024 08:43:33 GMT] : [ebebc577-14e1-43b7-965e-ed097641119b] : @azure/[email protected] : Verbose - Auth code client created
[2024-09-11 10:43:33.841] [info] [Wed, 11 Sep 2024 08:43:33 GMT] : [] : @azure/[email protected] : Verbose - Replacing tenant domain name c3af1697-15c2-44e3-99ae-9f34166c36fb with id {tenantid}
[2024-09-11 10:43:34.229] [info] [Wed, 11 Sep 2024 08:43:34 GMT] : [] : @azure/[email protected] : Info - acquireTokenByCode called
[2024-09-11 10:43:34.229] [info] [Wed, 11 Sep 2024 08:43:34 GMT] : [] : @azure/[email protected] : Verbose - initializeRequestScopes called
[2024-09-11 10:43:34.230] [info] [Wed, 11 Sep 2024 08:43:34 GMT] : [c76a70ee-6c5d-4898-8d68-a3ffd72a35f1] : @azure/[email protected] : Verbose - buildOauthClientConfiguration called
[2024-09-11 10:43:34.230] [info] [Wed, 11 Sep 2024 08:43:34 GMT] : [c76a70ee-6c5d-4898-8d68-a3ffd72a35f1] : @azure/[email protected] : Verbose - createAuthority called
[2024-09-11 10:43:34.231] [info] [Wed, 11 Sep 2024 08:43:34 GMT] : [] : @azure/[email protected] : Verbose - Attempting to get cloud discovery metadata from authority configuration
[2024-09-11 10:43:34.231] [info] [Wed, 11 Sep 2024 08:43:34 GMT] : [] : @azure/[email protected] : Verbose - Known Authorities:
[2024-09-11 10:43:34.231] [info] [Wed, 11 Sep 2024 08:43:34 GMT] : [] : @azure/[email protected] : Verbose - Authority Metadata: N/A
[2024-09-11 10:43:34.231] [info] [Wed, 11 Sep 2024 08:43:34 GMT] : [] : @azure/[email protected] : Verbose - Canonical Authority: https://login.microsoftonline.com/c3af1697-15c2-44e3-99ae-9f34166c36fb/
[2024-09-11 10:43:34.232] [info] [Wed, 11 Sep 2024 08:43:34 GMT] : [] : @azure/[email protected] : Verbose - Did not find cloud discovery metadata in the config... Attempting to get cloud discovery metadata from the hardcoded values.
[2024-09-11 10:43:34.232] [info] [Wed, 11 Sep 2024 08:43:34 GMT] : [] : @azure/[email protected] : Verbose - Found cloud discovery metadata from hardcoded values.
[2024-09-11 10:43:34.232] [info] [Wed, 11 Sep 2024 08:43:34 GMT] : [] : @azure/[email protected] : Verbose - Attempting to get endpoint metadata from authority configuration
[2024-09-11 10:43:34.232] [info] [Wed, 11 Sep 2024 08:43:34 GMT] : [] : @azure/[email protected] : Verbose - Did not find endpoint metadata in the config... Attempting to get endpoint metadata from the hardcoded values.
[2024-09-11 10:43:34.233] [info] [Wed, 11 Sep 2024 08:43:34 GMT] : [] : @azure/[email protected] : Verbose - Replacing tenant domain name c3af1697-15c2-44e3-99ae-9f34166c36fb with id {tenantid}
[2024-09-11 10:43:34.233] [info] [Wed, 11 Sep 2024 08:43:34 GMT] : [c76a70ee-6c5d-4898-8d68-a3ffd72a35f1] : @azure/[email protected] : Info - Building oauth client configuration with the following authority: https://login.microsoftonline.com/c3af1697-15c2-44e3-99ae-9f34166c36fb/oauth2/v2.0/token.
[2024-09-11 10:43:34.233] [info] [Wed, 11 Sep 2024 08:43:34 GMT] : [c76a70ee-6c5d-4898-8d68-a3ffd72a35f1] : @azure/[email protected] : Verbose - Auth code client created
[2024-09-11 10:43:34.234] [info] [Wed, 11 Sep 2024 08:43:34 GMT] : [] : @azure/[email protected] : Verbose - Replacing tenant domain name c3af1697-15c2-44e3-99ae-9f34166c36fb with id {tenantid}
[2024-09-11 10:43:34.457] [info] [Wed, 11 Sep 2024 08:43:34 GMT] : [c76a70ee-6c5d-4898-8d68-a3ffd72a35f1] : @azure/[email protected] : Verbose - setCachedAccount called
[2024-09-11 10:43:34.459] [info] [Wed, 11 Sep 2024 08:43:34 GMT] : [c76a70ee-6c5d-4898-8d68-a3ffd72a35f1] : @azure/[email protected] : Verbose - Persistence enabled, calling beforeCacheAccess
[2024-09-11 10:43:34.460] [info] [Wed, 11 Sep 2024 08:43:34 GMT] : [c76a70ee-6c5d-4898-8d68-a3ffd72a35f1] : @azure/[email protected] : Verbose - Persistence enabled, calling afterCacheAccess
Network Trace (Preferrably Fiddler)
MSAL Configuration
Relevant Code Snippets
Reproduction Steps
npm install
npm run package
Expected Behavior
User gets signed in from the redirect.
Identity Provider
Entra ID (formerly Azure AD) / MSA
Browsers Affected (Select all that apply)
Chrome, Edge, Safari
Regression
No response
Source
Internal (Microsoft)
The text was updated successfully, but these errors were encountered: