Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getAccessToken fail, interaction_required/AADSTS160021 #5339

Closed
krzysztof-plutoflume opened this issue Jan 31, 2025 · 5 comments
Closed

getAccessToken fail, interaction_required/AADSTS160021 #5339

krzysztof-plutoflume opened this issue Jan 31, 2025 · 5 comments
Labels
Area: Outlook Issue related to Outlook add-ins Needs: author feedback Waiting for author (creator) of Issue to provide more info Status: no recent activity Issue or PR is stale (no recent activity)

Comments

@krzysztof-plutoflume
Copy link

We have noticed occasional failures when trying to obtain an SSO access token.

The call

await OfficeRuntime.auth.getAccessToken({ allowSignInPrompt: true });

fails and there's no errorCode/errorMessage on the exception.

We can see that internally there's a redirect being performed to
https://outlook.office.com/mail/spaExtSSO.html#error=interaction_required&error_description=AADSTS160021%3a+Application+requested+a+user+session+which+does+not+exist.

Can you provide some more information about this error?

Your Environment

  • Platform [PC desktop, Mac, iOS, Office on the web]: Office on the web
  • Host [Excel, Word, PowerPoint, etc.]: Outlook
  • Office version number: N/A
  • Operating System: Windows, macOS
  • Browser (if using Office on the web): Edge, Chrome

Expected behavior

The access token can be obtained successfully.

Current behavior

The getAccessToken call fails with no error message/code, as described above.

Steps to reproduce

I don't currently have reliable steps to reproduce this issue.

@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs: triage 🔍 New issue, needs PM on rotation to triage ASAP label Jan 31, 2025
@exextoc exextoc added Area: Outlook Issue related to Outlook add-ins Needs: attention 👋 Waiting on Microsoft to provide feedback and removed Needs: triage 🔍 New issue, needs PM on rotation to triage ASAP labels Jan 31, 2025
@patilganesh-msft
Copy link

Hi @krzysztof-plutoflume,

Hi, thank you for reaching out. In order to debug further, could you please reproduce the issue and collect logs. Steps to collect logs is captured here - https://github.com/OfficeDev/office-js/wiki/Collecting-log-files-for-Outlook-Add%E2%80%90ins-issues and give the access to exextoc.
Most likely, it is happening due to the token getting expired (which is valid for ~1 hour).

Also, please let us know

  1. If you call getAccessToken again,are you able to get the token or do you need to refresh the add-in?
  2. Any errors office.js is throwing?

@patilganesh-msft patilganesh-msft added Needs: author feedback Waiting for author (creator) of Issue to provide more info and removed Needs: attention 👋 Waiting on Microsoft to provide feedback labels Feb 4, 2025
@microsoft-github-policy-service microsoft-github-policy-service bot added the Status: no recent activity Issue or PR is stale (no recent activity) label Feb 9, 2025
@krzysztof-plutoflume
Copy link
Author

I will update the issue with logs if I manage to reproduce again. As I said, I don't have a way to consistently reproduce, I was hoping that the error message from the redirect would help shed some light on the problem

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs: attention 👋 Waiting on Microsoft to provide feedback and removed Status: no recent activity Issue or PR is stale (no recent activity) Needs: author feedback Waiting for author (creator) of Issue to provide more info labels Feb 10, 2025
@DivyaPatidar
Copy link

@krzysztof-plutoflume Can you check following:

  • Is there any pattern they see, like does this occur when the client is inactive for long time? In that case the current session might have gone stale for some reason
  • What happens if we refresh and clear cache?
  • Can you check if any popups are being blocked by the browser when this issue occurs?"

@DivyaPatidar DivyaPatidar added Needs: author feedback Waiting for author (creator) of Issue to provide more info and removed Needs: attention 👋 Waiting on Microsoft to provide feedback labels Feb 11, 2025
@microsoft-github-policy-service microsoft-github-policy-service bot added the Status: no recent activity Issue or PR is stale (no recent activity) label Feb 16, 2025
Copy link
Contributor

This issue has been automatically marked as stale because it is marked as needing author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. Thank you for your interest in Office Add-ins!

Copy link
Contributor

This issue has been closed due to inactivity. Please comment if you still need assistance and we'll re-open the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Outlook Issue related to Outlook add-ins Needs: author feedback Waiting for author (creator) of Issue to provide more info Status: no recent activity Issue or PR is stale (no recent activity)
Projects
None yet
Development

No branches or pull requests

4 participants