Microsoft 365 Error Codes

How to Fix AADSTS165000 Error When Adding Work Email to iPhone Mail

Adam DavisAdam Davis Oct 28, 2026 869 views

Question details

Users encounter an authentication token mismatch error preventing them from accessing their organizational email.

How to Fix AADSTS165000 Error When Adding Work Email to iPhone Mail
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.
Before you start

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.

Solution 1Recommended

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.

1
Open Mail Settings

Open the Settings app on your iPhone and navigate to the 'Mail' section, then tap on 'Accounts'.

2
Delete the Problematic Account

Locate the work account that failed to add properly, tap on it, and select 'Delete Account' at the bottom of the screen.

3
Restart Your Device

Power your iPhone off completely and turn it back on to clear any lingering cache or authentication tokens from the system memory.

4
Re-add the Account

Go back to 'Settings' > 'Mail' > 'Accounts' > 'Add Account'. Choose 'Microsoft Exchange' and follow the prompts using the correct work-account sign-in option.

Remove the Failed Account and Re-Add It
Tip for Re-adding: When prompted, ensure you select 'Sign In' rather than trying to configure the server details manually, as this leverages modern authentication.
Free Microsoft Office alternative

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.

Fully compatible with Microsoft Word, Excel, and PowerPoint formats (.docx, .xlsx, .pptx).Lightweight mobile application optimized for iPhone and iPad.Free to download and use with a highly intuitive user interface.Easily open and manage email attachments directly on your mobile device.
microsoft office alternative - wps office

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.