question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Identity] - Provide a story of how to use InteractiveBrowserCredential on Electron

See original GitHub issue
  • Package Name: @azure/identity
  • Package Version: 1.2.1
  • Operating system: Windows 10
  • nodejs
    • version: 12.18.3
  • browser
    • name/version: Chrome 87.0.4280.88
  • electron
    • Electron 11.1.1

Describe the bug InteractiveBrowserCredential does not work in Electron even when run from the renderer (chromium) process.

To Reproduce Steps to reproduce the behavior:

  1. Clone this sample: https://github.com/maorleger/electron-repro
  2. Update renderer.js as follows:
    • privateBlob: should point to a blob that is private
  3. Run the sample npm start
  4. (optional) Clear the dev tools console
  5. Click on the button Trigger auth
  6. Sign in

Expected behavior InteractiveBrowserAuth does not currently work in Electron which may be expected - instead of a popup it launches a new tab in the default browser, but the redirect URI that is called is called in the same browser so nothing is listening for it.

Instead, my electron sample (in the Azure SDK for JS repo) uses the AuthCodeCredential which works well. So I think I might have expected either:

  1. InteractiveBrowserCredential to Just Work ™ or
  2. Maybe some documentation about Electron and needing the AuthCodeCredential? As we discussed it might be the right credential to use for Electron but it would be great if that was easy to find

Additional context

Feel free to reach out to me if you run into any issues!

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
sadasantcommented, Jan 25, 2021

I’d like to test this with MSAL 2.0. I’ll ping you about it.

0reactions
sadasantcommented, Jun 8, 2021

I’ll move this to the backlog since we don’t have a clear picture of when we’ll able to pick this up.

Read more comments on GitHub >

github_iconTop Results From Across the Web

azure-sdk-for-js/AzureIdentityExamples.md at main - GitHub
This document covers several use cases of Identity with greater context and links to the underlying authentication flows and other available documentation.
Read more >
InteractiveBrowserCredential class - Microsoft Learn
Enables authentication to Azure Active Directory inside of the web browser using the interactive login flow.
Read more >
Azure Identity SDK (JS) How to Authenticate to User's Azure ...
InteractiveBrowserCredential is one way to launches the system default browser to interactively authenticate a user and obtain an access token.
Read more >
Managed Identity simplified with the new Azure .NET SDKs!
InteractiveBrowserCredential : launches the browser to interactively authenticate a user. You can obtain your AD credential like this: using ...
Read more >
Azure Identity 201 - DefaultAzureCredential Options
As mentioned above the InteractiveBrowserCredential is not included by ... Azure Identity now provides a setting that allows you to take ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found