Skip to content

Commit 5f99da5

Browse files
authored
Merge pull request #9038 from MicrosoftDocs/users/chcomley/562657-auth-methods-update
Security updates - auth tokens are not a data contract
2 parents 04a9f75 + 366ecff commit 5f99da5

2 files changed

Lines changed: 28 additions & 13 deletions

File tree

docs/integrate/get-started/authentication/authentication-guidance.md

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ ai-usage: ai-assisted
1010
monikerRange: '<= azure-devops'
1111
ms.author: chcomley
1212
author: chcomley
13-
ms.date: 03/03/2026
13+
ms.date: 03/18/2026
1414
---
1515

1616
# Authentication methods for Azure DevOps
1717

1818
[!INCLUDE [version-lt-eq-azure-devops](../../../includes/version-lt-eq-azure-devops.md)]
1919

2020
This article describes authentication methods for Azure DevOps integration and helps you choose the best option for your scenario.
21-
Modern authentication approaches like Microsoft Entra ID provide enhanced security and the best approach for new applications.
21+
Modern authentication approaches like Microsoft Entra ID provide enhanced security and are the best approach for new applications.
2222

2323
Use Microsoft Entra ID authentication for new applications that integrate with Azure DevOps Services.
2424
Use personal access tokens sparingly, and only when Microsoft Entra ID isn't available.
@@ -67,9 +67,7 @@ The following sections provide recommendations for getting started in different
6767
- Use personal access tokens for Azure DevOps Server scenarios when they're acceptable.
6868
- Plan for future Azure DevOps Services migration to take advantage of modern authentication.
6969

70-
## Answers to common questions
71-
72-
The following sections provide answers to frequently asked questions.
70+
## Frequently asked questions (FAQ)
7371

7472
### Should I use Microsoft Entra ID OAuth or personal access tokens?
7573

@@ -80,7 +78,7 @@ Use Microsoft Entra ID OAuth in the following scenarios:
8078
- Applications that need enterprise identity integration.
8179
- Long-term projects with compliance requirements.
8280

83-
Only use personal access tokens in the following scenarios:
81+
Use personal access tokens only in the following scenarios:
8482

8583
- Personal scripts and ad hoc tasks.
8684
- Legacy applications during migration planning.
@@ -113,7 +111,7 @@ Use the `requestContext` method to detect the service type, and apply the approp
113111

114112
### Why can't my service account access Azure DevOps APIs?
115113

116-
Here are some common issues that can affect service account access:
114+
Here are some common issues that affect service account access:
117115

118116
- **Service account not "materialized"**: Use the correct sign-in method. Service accounts need interactive sign-in permissions or proper Microsoft Entra ID registration.
119117
- **Insufficient permissions**: Ensure that the service account has appropriate Azure DevOps permissions.
@@ -136,19 +134,33 @@ Follow these steps:
136134

137135
1. Monitor and validate the new authentication method.
138136

137+
### Why shouldn't I decode or read claims from authentication tokens?
138+
139+
Authentication tokens exist solely to prove *who* the caller is and *what they're authorized to do*. They're not a stable data interface or a schema you can depend on.
140+
141+
Token claims are never publicly documented, and Azure DevOps reserves the right to change, rename, remove, or encrypt them at any time without notice. Starting summer 2025, Azure DevOps is further encrypting authentication tokens, which means clients can't read token payloads. Any application that decodes tokens to extract claims breaks.
142+
143+
Instead of reading token claims, follow these practices:
144+
145+
- **Treat tokens as opaque** — pass them in authorization headers, but don't decode or inspect them.
146+
- **Use supported REST APIs** — retrieve user or organization data from [Azure DevOps REST APIs](/rest/api/azure/devops), which provide stable contracts and documentation.
147+
- **Assume any claim can change** — if you find yourself parsing token contents to read values, put that logic in an API call instead.
148+
149+
These changes don't affect applications that already treat tokens as opaque.
150+
139151
## Implementation procedures
140152

141-
After you choose the authentication method for your scenario, finish the implementation:
153+
After you choose the authentication method for your scenario, finish the implementation steps:
142154

143-
- **New applications**: [Build Azure DevOps integrations with Microsoft Entra OAuth apps](entra-oauth.md)
144-
- **Service applications**: [Use service principals and managed identities in Azure DevOps](service-principal-managed-identity.md)
145-
- **Personal scripts**: [Use personal access tokens](../../../organizations/accounts/use-personal-access-tokens-to-authenticate.md)
155+
- **New applications**: [Build Azure DevOps integrations with Microsoft Entra OAuth apps](entra-oauth.md).
156+
- **Service applications**: [Use service principals and managed identities in Azure DevOps](service-principal-managed-identity.md).
157+
- **Personal scripts**: [Use personal access tokens](../../../organizations/accounts/use-personal-access-tokens-to-authenticate.md).
146158

147159
<a id="use-ai-assistance"></a>
148160

149161
## Use AI to choose an authentication method
150162

151-
If you have the [Azure DevOps MCP Server](../../../mcp-server/mcp-server-overview.md) connected to your AI agent in agent mode, you can use natural language prompts to get authentication recommendations for your scenario.
163+
If you connect the [Azure DevOps MCP Server](../../../mcp-server/mcp-server-overview.md) to your AI agent in agent mode, you can use natural language prompts to get authentication recommendations for your scenario.
152164

153165
| Task | Example prompt |
154166
|------|----------------|

docs/organizations/security/data-protection.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ms.subservice: azure-devops-security
77
ms.author: chcomley
88
author: chcomley
99
ms.reviewer: jominana
10-
ms.date: 02/26/2026
10+
ms.date: 03/18/2026
1111
monikerRange: 'azure-devops'
1212
ms.custom: freshness-fy22, sfi-ropc-nochange, pat-reduction
1313
---
@@ -173,6 +173,9 @@ Microsoft is committed to ensuring that your projects remain safe and secure, wi
173173
* OAuth credentials issue as fully self-describing JSON web tokens (JWTs) and aren't stored in our service.
174174
* The claims in JWTs issued and presented to our service get validated using a certificate stored in our key vault.
175175

176+
> [!IMPORTANT]
177+
> Azure DevOps is encrypting authentication tokens. After encryption takes effect, token payloads are no longer readable by clients. Applications that decode tokens to extract claims will break. Always treat tokens as opaque — use them only for authorization, and call [Azure DevOps REST APIs](/rest/api/azure/devops) to retrieve user or organization data. For more information, see [Why shouldn't I decode or read claims from authentication tokens?](../../integrate/get-started/authentication/authentication-guidance.md#why-shouldnt-i-decode-or-read-claims-from-authentication-tokens)
178+
176179
### Reporting security flaws
177180

178181
If you believe that your penetration testing revealed a potential security flaw related to the Azure DevOps service, report it to Microsoft within 24 hours. For more information, see the [Microsoft webpage for reporting a computer security vulnerability](https://technet.microsoft.com/organizations/security/ff852094).

0 commit comments

Comments
 (0)