You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
22
22
23
23
Use Microsoft Entra ID authentication for new applications that integrate with Azure DevOps Services.
24
24
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
67
67
- Use personal access tokens for Azure DevOps Server scenarios when they're acceptable.
68
68
- Plan for future Azure DevOps Services migration to take advantage of modern authentication.
69
69
70
-
## Answers to common questions
71
-
72
-
The following sections provide answers to frequently asked questions.
70
+
## Frequently asked questions (FAQ)
73
71
74
72
### Should I use Microsoft Entra ID OAuth or personal access tokens?
75
73
@@ -80,7 +78,7 @@ Use Microsoft Entra ID OAuth in the following scenarios:
80
78
- Applications that need enterprise identity integration.
81
79
- Long-term projects with compliance requirements.
82
80
83
-
Only use personal access tokens in the following scenarios:
81
+
Use personal access tokens only in the following scenarios:
84
82
85
83
- Personal scripts and ad hoc tasks.
86
84
- Legacy applications during migration planning.
@@ -113,7 +111,7 @@ Use the `requestContext` method to detect the service type, and apply the approp
113
111
114
112
### Why can't my service account access Azure DevOps APIs?
115
113
116
-
Here are some common issues that can affect service account access:
114
+
Here are some common issues that affect service account access:
117
115
118
116
-**Service account not "materialized"**: Use the correct sign-in method. Service accounts need interactive sign-in permissions or proper Microsoft Entra ID registration.
119
117
-**Insufficient permissions**: Ensure that the service account has appropriate Azure DevOps permissions.
@@ -136,19 +134,33 @@ Follow these steps:
136
134
137
135
1. Monitor and validate the new authentication method.
138
136
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
+
139
151
## Implementation procedures
140
152
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:
142
154
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).
146
158
147
159
<aid="use-ai-assistance"></a>
148
160
149
161
## Use AI to choose an authentication method
150
162
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.
@@ -173,6 +173,9 @@ Microsoft is committed to ensuring that your projects remain safe and secure, wi
173
173
* OAuth credentials issue as fully self-describing JSON web tokens (JWTs) and aren't stored in our service.
174
174
* The claims in JWTs issued and presented to our service get validated using a certificate stored in our key vault.
175
175
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
+
176
179
### Reporting security flaws
177
180
178
181
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