AzureAD / microsoft-authentication-library-for-js

Microsoft Authentication Library (MSAL) for JS
http://aka.ms/aadv2
MIT License
3.61k stars 2.64k forks source link

msal-browser failed in Office Addin Dialog API #6823

Closed Edward-Zhou closed 7 months ago

Edward-Zhou commented 8 months ago

Core Library

MSAL.js (@azure/msal-browser)

Core Library Version

^3.7.0

Wrapper Library

MSAL React (@azure/msal-react)

Wrapper Library Version

^2.0.9

Public or Confidential Client?

Public

Description

I am trying to use @azure/msal-browser and @azure/msal-react to enable Excel addin support microsoft sso and access Graph api.

Due to that Excel addin does not support access external url from Excel taskpane, i need to access @azure/msal-browser in dialog api which can be referece Enable single sign-on (SSO) in an Office Add-in.

If I use PublicClientApplication in normail excel addin project like react React single-page application using MSAL React to authenticate users against Azure AD for Customers, I am able to access the authorize consent page.

But, I open the page from dialog api like below:

 Office.context.ui.displayDialogAsync('https://localhost:3000/dialog.html', {height: 30, width: 20, displayInIframe: true});

And in the dialog page, it will call

const msalInstance = new PublicClientApplication(msalConfig);

I will throw error below: image

MSAL Configuration

No response

Relevant Code Snippets

No response

Identity Provider

Azure AD / MSA

Source

External (Customer)

Edward-Zhou commented 8 months ago

This specific to @azure/msal-browser version ^3.7.0, if I switch to ^2.28.1, the error will gone.

tnorling commented 7 months ago

Is there anymore information you can provide? We don't have anything called "register" in our codebase

microsoft-github-policy-service[bot] commented 7 months ago

@Edward-Zhou This issue has been automatically marked as stale because it is marked as requiring author feedback but has not had any activity for 5 days. If your issue has been resolved please let us know by closing the issue. If your issue has not been resolved please leave a comment to keep this open. It will be closed automatically in 7 days if it remains stale.