Closed FrancoBimco closed 10 months ago
I'd try handling the response in the original window instead of in the child window. Don't call any MSAL APIs inside the child window.
Doing it this way keeps the cache in the parent window rather than in the ephemeral child window.
@FrancoBimco 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.
Core Library
MSAL.js (@azure/msal-browser)
Core Library Version
3.5.0
Wrapper Library
MSAL React (@azure/msal-react)
Wrapper Library Version
2.0.7
Public or Confidential Client?
Public
Description
I am developing an add-in for Outlook and I have several accounts tied to my organization's tenant, so whenever I am trying to log in and set the active account I am stopped since office add-in don't allow redirects in the same window / browser instance as the original taskpane that sent the request.
First error: I try to ask for the accounts that I am logged in to, it work for about 3 weeks but now I am forced to select one of the accounts using an UI, which forces to use an Office dialog. (before I could ask for all of the accounts and I could programatically select an account, but this is no longer available for a reason I can't seem to find out). But once I am on my Dialog window, msal can easily fetch all of my accounts and I can fetch my tokens without any issues.
Second "error": This might not really be an error, but just a lack of understanding from my part. Since I am forced to do an interaction to select the account which the app should fetch the tokens on behalf of, I launch a dialog in which I instantiate an MsalInstance, handle the redirect promise, get the account info and tokens correctly for my account and then I try to send them back to my original calling window through Json message. Once received, I try to either fetch the account using the getAccount with the idToken claims, accountInfo, and other elements from the message sent by my Dialog window, this always returns a null. I also try to set the account by using setActiveAccount using the account info I got in my Dialog window, but this does not work at all.
Error Message
InteractionRequiredAuthError
Msal Logs
No response
MSAL Configuration
Relevant Code Snippets
Reproduction Steps
Expected Behavior
I would have expected that I could use the token claims from my child window to authenticate in my original taskpane and re-use the account info so that I can fetch new tokens, etc... This is a business add-in and it would be very annoying for my users to have to select an account every single time they want to call an API and that their token is expired.
Identity Provider
Azure AD / MSA
Browsers Affected (Select all that apply)
Internet Explorer
Regression
No response
Source
External (Customer)