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.

Serializing and importing/exporting accounts

See original GitHub issue

Core 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:closed
  • Created 2 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
sameeragcommented, Jan 20, 2022

@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.

0reactions
sameeragcommented, Feb 15, 2022

Added this to the backlog of UX team. Closing the ticket.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Totally Useful - [Import and export users and customers] Review
I notice that some of the meta-data fields in the CSV are serialized, so not human friendly but that's fine for an export-import...
Read more >
Serializing Data - Solana Cookbook
Learn how to serialize and deserialize data on Solana.
Read more >
Serialize and Deserialize objects to JSON (or whatever) format |
Serialize.Template class, it'll be relatively easy to adapt it to have a pre-compiled export/import methods to export/import data in whatever ...
Read more >
8.3 Exporting and Importing Mining Models - Oracle Help Center
You can export data mining models to flat files to back up work in progress or to move models to a different ......
Read more >
export/import without json serializing · Issue #110 - GitHub
I would really like to export the index to IndexedDB. However, for that case there is no need to JSON serialize it, and...
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