Skip to content

In SSO Fallback, getAccessTokenMSAL() returns a different user than Office.auth.getAccessToken() #790

Open
@CBullen2

Description

URL of sample

Office-Add-in-NodeJS-SSO

Describe the bug

My primary Windows login is a Microsoft Personal Account. I also have a Work account linked to it and I can switch between them in the browser and in Excel.

When I start Excel, by default, it uses my Personal Account. When my add-in calls Office.auth.getAccessToken(), I get the JWT for that account.

When my add-in falls back to getAccessMSAL(), I get the JWT for my work account, which is not the account I'm using in Excel.

To Reproduce

Steps to reproduce the behavior:

  1. Create a new Microsoft personal account and log in to Windows with it
  2. In Windows settings, add a work account
  3. Start Excel, note the name in the Window title bar is the personal account
  4. Open the addin, set useSSO = true, run it and check the JWT - notice it's the personal account
  5. set useSSO = false, run it and check the JWT - notice it's the work account

Note that the above might depend on which account(s) are logged in on the browser.

Expected behavior

Both Office.auth.getAccessToken and getAcessTokenMSAL should return the same account, and that should be the one logged in to Excel

Environment

  • Platform [PC desktop, Mac, iOS, Office Online]: PC desktop
  • Host [Excel, Word, PowerPoint, etc.]: Excel
  • Office version number: version 2405
  • Operating System: Windows 11
  • Browser (if using Office Online): ______

Additional context

Add any other context about the problem here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions