[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:
- Clone this sample: https://github.com/maorleger/electron-repro
- Update
renderer.js
as follows:- privateBlob: should point to a blob that is private
- Run the sample
npm start
- (optional) Clear the dev tools console
- Click on the button
Trigger auth
- 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:
- InteractiveBrowserCredential to Just Work ™ or
- 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:
- Created 3 years ago
- Comments:5 (5 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’d like to test this with MSAL 2.0. I’ll ping you about it.
I’ll move this to the backlog since we don’t have a clear picture of when we’ll able to pick this up.