How to Fix AADSTS165000 Error When Adding Work Email to iPhone Mail
Question details
Users encounter an authentication token mismatch error preventing them from accessing their organizational email.

- Product
- Microsoft 365
- Device & OS
- iOS
- Scenario
- Adding a work, school, or NHS Microsoft 365 email account to the default iPhone Mail application.
- Observed behavior
- The authentication process fails and displays the error code AADSTS165000, which indicates that the authentication tokens do not match the user context.
Ensure you have your correct work email address and password, and verify that your iPhone has an active and stable internet connection before attempting to re-add your account.
Remove the Failed Account and Re-Add It
Clear any stalled authentication processes or corrupted cache by completely removing the problematic account entry and starting fresh.
Sometimes, temporary glitches during the sign-in process can cause mismatched authentication tokens. Resetting the connection by deleting the incomplete account profile and restarting the device often resolves this issue.
Open the Settings app on your iPhone and navigate to the 'Mail' section, then tap on 'Accounts'.
Locate the work account that failed to add properly, tap on it, and select 'Delete Account' at the bottom of the screen.
Power your iPhone off completely and turn it back on to clear any lingering cache or authentication tokens from the system memory.
Go back to 'Settings' > 'Mail' > 'Accounts' > 'Add Account'. Choose 'Microsoft Exchange' and follow the prompts using the correct work-account sign-in option.

Contact Your Organization's IT Administrator
If the error persists after a device restart, it is likely an Azure AD configuration issue that requires administrative access to resolve.
Manage Your Work Documents with WPS Office
While waiting for your IT team to resolve email connectivity issues, you can still maintain high productivity. WPS Office is a powerful, free, and lightweight alternative to Microsoft Office that works seamlessly on your iPhone, allowing you to view, edit, and share work documents without complex administrative setups.

Frequently Asked Questions
What does the AADSTS165000 error mean on an iPhone?
This error code indicates that the authentication tokens provided during the login process do not match the expected user context. It usually points to a conflict or security restriction in your organization's Azure Active Directory (Azure AD).
Can I bypass the AADSTS165000 error myself?
You can attempt to resolve it by deleting the failed account setup, restarting your iPhone, and attempting to log in again. However, if it stems from strict organizational security policies, you cannot bypass it without your IT administrator's help.
Why does this happen specifically with my NHS or corporate email?
Large organizations use strict security policies in Microsoft 365 to protect sensitive data. If the default iPhone Mail app does not meet certain conditional access criteria or requires specific device enrollment set by the organization, the connection will be blocked, resulting in this error.
Should I use the Outlook app instead of the Apple Mail app?
Yes. Organizations often prefer or require employees to use the official Microsoft Outlook app for iOS because it natively supports advanced Azure AD security policies and conditional access rules better than the built-in Apple Mail app.




