Share via

AADSTS165002: Internal Error: when logging into the desktop apps on a MAC

Robert Velasco 0 Reputation points
2026-02-18T15:00:34.5666667+00:00

I just bought a subscription using the work discount program and can log into the account and use the apps on the web and the local copilot app but every time I try to use the local app for word or excel, etc it gives me this error:

AADSTS165002: Internal Error: The user session context is missing. One or more of the user context values (cookies; form fields; headers) were not supplied, every request must include these values and maintain them across a complete single user flow. Failure Reasons:[Missing session context cookie;Invalid token value;]

Request Id: [Moderator note: personal info removed]

Correlation [Moderator note: personal info removed]

Timestamp: 2026-02-18T14:56:36Z

Message: AADSTS165002: Internal Error: The user session context is missing. One or more of the user context values (cookies; form fields; headers) were not supplied, every request must include these values and maintain them across a complete single user flow. Failure Reasons:[Missing session context cookie;Invalid token value;]

Flag sign-in errors for review:

If you plan on getting help for this problem, enable flagging and try to reproduce the error within 20 minutes. Flagged events make diagnostics available and are raised to admin attention.

Please assist

Microsoft 365 and Office | Word | For business | MacOS
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Jack-Bu 6,525 Reputation points Microsoft External Staff Moderator
    2026-02-19T07:56:06.32+00:00

    Please note that Q&A forum is a public platform, and moderators will modify the question to hide personal information in the description. Kindly ensure that you hide any personal or organizational information the next time you post an error or other details to protect personal data.

    Hello Robert,

    Thank you for reaching out to Microsoft Q&A. The error you're encountering typically points to an authentication issue with Microsoft Azure Active Directory during the sign-in process for desktop apps like Word and Excel on macOS. This can stem from mismatched or missing session data, often related to cached credentials, keychain entries, or configuration problems.

    Since you can access your account via the web and the Copilot app, the problem is likely isolated to the local Office installation. Here some basic steps to fix it:

    First, let try sign out and in again, this can refresh the session context mentioned in the error.

    • Open any Office app (e.g., Word) and go to Help > Sign Out (if available) or close all Office apps completely.
    • Quit the apps via the menu bar (e.g., Word > Quit Word) or use Activity Monitor to force quit if needed.
    • Reopen the app and attempt to sign in with your Microsoft account credentials.

    Next, you can try to reset Keychain for MS office:

    • macOS keychain often stores corrupted credentials causing session mismatches.
    • Close all Office apps.
    • Open Finder > Applications > Utilities > Keychain Access.
    • In the search bar (top right), type and delete all entries containing: "Office", "Microsoft", "Exchange", "ADAL".

    Right-click each matching item and select Delete. If prompted for repeated keychain access later, enter your Mac admin password and allow it. Restart your Mac, then reopen an Office app and sign in.

    If the issue persists, remove and reinstall Office Apps:

    Download and run the Microsoft License Removal Tool for Mac to clear old license data.

    Then uninstall Office and reinstall from the Microsoft 365 portal.

    After reinstall, sign in immediately.

    Hope this help.


    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  2. Q&A Assist
    2026-02-18T15:00:46.4633333+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    The error message you're encountering, AADSTS165002, indicates that there is a problem with the user session context when trying to log into the Microsoft 365 desktop apps on your Mac. This can occur for several reasons, including missing cookies or invalid token values.

    Here are some steps you can take to troubleshoot and potentially resolve the issue:

    1. Sign Out and Sign In Again: Make sure to sign out of all Microsoft 365 apps and then sign back in. This can sometimes refresh the session and resolve the issue.
    2. Clear Cache and Cookies: Clearing your browser's cache and cookies may help. Since the error mentions missing session context cookies, this could be a contributing factor.
    3. Check for Updates: Ensure that your Microsoft 365 apps are up to date. Sometimes, updates include fixes for known issues.
    4. Reinstall the Apps: If the issue persists, consider uninstalling and then reinstalling the Microsoft 365 apps on your Mac. This can help reset any corrupted files or settings.
    5. Check Security Software: If you have any security software installed, it might be blocking the necessary connections. Temporarily disabling it could help identify if it's causing the issue.
    6. Contact Support: If none of the above steps work, consider reaching out to Microsoft Support for further assistance, especially since the error message suggests flagging the event for review.

    Following these steps should help you address the internal error you're experiencing when trying to log into the desktop apps.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.