microsoft-authentication-library-for-js icon indicating copy to clipboard operation
microsoft-authentication-library-for-js copied to clipboard

Doesn't work with chrome extensions

Open curved-gulden opened this issue 9 months ago • 1 comments

Core Library

MSAL.js (@azure/msal-browser)

Core Library Version

4.4.0

Wrapper Library

Not Applicable

Wrapper Library Version

2.0.0

Public or Confidential Client?

Public

Description

In your samples documentation, you show a MSAL setup for ChromiumApp.

This does not work. It does not persist. And since it uses a popup, this gets a new local storage or session storage every time it's clicked.

This means none of your authentication state is persisted.

React also doesn't work. You can get it working with <MsalProvider/> with a lot of workarounds, even though there is NO documentation regarding this.

But even then authentication state is not persisting in any way, shape or form. If you have content scripts, popup windows, or anything else, you have to again and again sign in.

The sample is also using a 5 year old version and is completely outdated.

Please show a working (react) typescript sample that ACTUALLY works in a browser extension.

Error Message

none

MSAL Logs

No response

Network Trace (Preferrably Fiddler)

  • [ ] Sent
  • [ ] Pending

MSAL Configuration

{ as per documentation }

Relevant Code Snippets

your own samples.

Reproduction Steps

  1. clone sample
  2. add settings
  3. run the auth
  4. close popup and open again.
  5. you now have to AGAIN sign in.

Expected Behavior

auth state is persisted. react library works.

Identity Provider

Entra ID (formerly Azure AD) / MSA

Browsers Affected (Select all that apply)

Chrome

Regression

No response

curved-gulden avatar Feb 25 '25 18:02 curved-gulden

Any comment or interest in it being completely broken whatsoever?

ghost avatar Apr 02 '25 12:04 ghost

ANY updates whatsoever?! Is anybody even still active on this library or what?!

unmade-spangle avatar Jun 10 '25 20:06 unmade-spangle

Closing as duplicate of #3923. We're aware of the limitation but unfortunately haven't been able to prioritize the changes that would be required to make this work.

tnorling avatar Jun 30 '25 21:06 tnorling