Serializing and importing/exporting accounts
See original GitHub issueCore Library
MSAL.js v2 (@azure/msal-browser)
Core Library Version
2.20.0
Wrapper Library
MSAL React (@azure/msal-react)
Wrapper Library Version
1.1.2
Description
Is there a way to serialize an account object, and inserting it into another instance of Msal? So I could log in one place, and transfer the session to a different (isolated) msalInstance?
Background: I’ve run into an issue with logging out of web pages displayed inside an Adobe Premiere Pro panel/web view.
Premiere extensions are normal web pages displayed inside a Chromium Embedded Framework (CEF) instance. In addition to normal web features, CEF includes a node runtime, and allows importing node modules for added features. This also includes exposing a global module
object.
An unfortunate side effect of this is that jQuery won’t add itself to the window-object when module exists, and the AAD Sign-out-redirect page (https://login.microsoftonline.com/{tenantId}/oauth2/v2.0/logoutsession) fails with jQuery is not defined
. Apparently this used to be an issue with Electron as well, before they switched away from CEF.
I’m guessing that a change to the AAD sign out page is a bit too much to ask for, so instead I’m exploring the option of doing the login/logout part in another panel (with node integration disabled, so jQuery loads as expected), and passing account objects using inter-panel messaging. Panels do not share any browser storage, so cookies/localstorage/sessionstorage is isolated. And I can’t add any custom url/protocol handlers, and solve it the way I’d do it in Electron. I think I would be able to do it using a custom cacheProvider, making some kind of distributed cache, but using msal-browser my options are limited there.
MSAL Configuration
No response
Relevant Code Snippets
Full error message:
Uncaught ReferenceError: jQuery is not defined
at jquery.3.5.min_dc940oomzau4rsu8qesnvg2.js:5
(anonymous) @ jquery.3.5.min_dc940oomzau4rsu8qesnvg2.js:5
Uncaught Error: Cannot find module 'jquery'
Require stack:
- /tenantId/oauth2/v2.0/logoutsession
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:947)
at Function.Module._load (node:internal/modules/cjs/loader:787)
at Module.require (node:internal/modules/cjs/loader:1019)
at require (node:internal/modules/cjs/helpers:92)
at jQuery.migrateMute.jQuery.migrateMute (watsonsupportwithjquery.3.5.min_dc940oomzau4rsu8qesnvg2.js:5)
at watsonsupportwithjquery.3.5.min_dc940oomzau4rsu8qesnvg2.js:5
Identity Provider
Azure AD / MSA
Source
External (Customer)
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (6 by maintainers)
Top GitHub Comments
@ToshB I reached out to our UX team to first rule out the possibility of logout page in web panels can be supported better. Let me hear back from them before we explore other options.
Added this to the backlog of UX team. Closing the ticket.