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 helps you choose the most appropriate authentication method for your Azure DevOps integration. Modern authentication approaches like Microsoft Entra ID provide enhanced security and are recommended for new applications.
21
-
22
20
> [!IMPORTANT]
23
-
> **Microsoft Entra ID authentication is recommended** for new applications integrating with Azure DevOps Services. Personal access tokens should be used sparingly and only when modern authentication isn't available.
21
+
> **Microsoft Entra ID authentication is recommended** for new applications integrating with Azure DevOps Services. Personal access tokens should be used sparingly and only when Microsoft Entra ID isn't available.
22
+
23
+
This article helps you choose the most appropriate authentication method for your Azure DevOps integration. Modern authentication approaches like Microsoft Entra ID provide enhanced security and are recommended for new applications.
24
24
25
25
> [!NOTE]
26
26
> OAuth 2.0 and Microsoft Entra ID authentication are only available for Azure DevOps Services, not Azure DevOps Server. For on-premises scenarios, use [Client Libraries](../../concepts/dotnet-client-libraries.md), Windows Authentication, or [personal access tokens](../../../organizations/accounts/use-personal-access-tokens-to-authenticate.md).
@@ -31,21 +31,14 @@ Choose the appropriate authentication method based on your application type and
31
31
32
32
| Application Type | Description | Example | Recommended Method | Code Samples |
|**Modern web/desktop apps**| Interactive applications using current frameworks | React app, .NET desktop app |[Microsoft Entra ID OAuth](./entra-oauth.md) with MSAL |[sample](https://github.com/microsoft/azure-devops-auth-samples/tree/master/ManagedClientConsoleAppSample)|
34
+
|**Web/desktop apps**| Interactive applications using current frameworks | React app, .NET desktop app |[Microsoft Entra ID OAuth](./entra-oauth.md) with MSAL |[sample](https://github.com/microsoft/azure-devops-auth-samples/tree/master/ManagedClientConsoleAppSample)|
35
35
|**Service/background apps**| Applications running without user interaction | Azure Functions, background services |[Service principals & managed identities](./service-principal-managed-identity.md)|[sample](https://github.com/microsoft/azure-devops-auth-samples/tree/master/ServicePrincipalsSamples)|
36
36
|**Legacy client apps**| Existing applications using client libraries | Console apps with Azure DevOps .NET libraries |[Client Libraries](../../concepts/dotnet-client-libraries.md) with OAuth |[sample](https://github.com/Microsoft/vsts-auth-samples/tree/master/ClientLibraryConsoleAppSample)|
|**Azure DevOps extensions**| Extensions running within Azure DevOps | Custom dashboard widgets, work item forms |[VSS Web Extension SDK](https://github.com/Microsoft/azure-devops-extension-sdk)|[sample](../../../extend/develop/add-dashboard-widget.md)|
39
39
|**Azure DevOps Server apps**| On-premises Azure DevOps Server integrations | Custom server extensions |[Client Libraries](../../concepts/dotnet-client-libraries.md) or Windows Auth |[sample](https://github.com/Microsoft/vsts-auth-samples/tree/master/ClientLibraryConsoleAppSample)|
40
40
|**Personal/ad-hoc scripts**| Quick scripts for personal use | PowerShell scripts, curl commands |[Personal Access Tokens](../../../organizations/accounts/use-personal-access-tokens-to-authenticate.md)|[examples](../../how-to/call-rest-api.md)|
41
41
42
-
### Security recommendation hierarchy
43
-
44
-
-**Best**: Microsoft Entra ID OAuth with service principals or managed identities
45
-
-**Good**: Microsoft Entra ID OAuth with user delegation
46
-
-**Acceptable**: Client Libraries with OAuth authentication
47
-
-**Use sparingly**: Personal Access Tokens
48
-
49
42
## Getting started recommendations
50
43
51
44
### For new applications
@@ -76,19 +69,21 @@ A:
76
69
**Use Personal Access Tokens only for**:
77
70
- Personal scripts and ad-hoc tasks
78
71
- Legacy applications during migration planning
79
-
- Azure DevOps Server scenarios where modern auth isn't available
72
+
- Azure DevOps Server scenarios where modern authentication isn't available
80
73
81
-
### Q: Should I use Client Libraries or REST APIs?
74
+
### Q: Should I use service principals or user delegation for authentication?
82
75
A:
83
-
**Use Azure DevOps Client Libraries** when:
84
-
- Building .NET applications
85
-
- You need simplified API interactions
86
-
- You want automatic handling of API version changes
87
-
88
-
**Use REST APIs directly** when:
89
-
- Building in non-.NET languages
90
-
- You need access to newer APIs not yet in client libraries
91
-
- You want maximum control over API interactions
76
+
**Use service principals or managed identities** when:
77
+
- Building applications that operate independently (background services, automation)
78
+
- Creating apps that don't require user interaction
79
+
- Implementing service-to-service communication
80
+
- Building CI/CD pipelines or automated workflows
81
+
82
+
**Use user delegation (OAuth with user consent)** when:
83
+
- Building applications that act on behalf of human users
84
+
- Creating interactive apps where users sign in with their own credentials
85
+
- Implementing features that require user-specific permissions
86
+
- Building apps that need to respect user's individual access rights
92
87
93
88
### Q: How do I authenticate with both Azure DevOps Server and Azure DevOps Services?
94
89
A:
@@ -138,5 +133,5 @@ Choose your authentication implementation:
138
133
-[Azure DevOps Services REST API reference](/rest/api/azure/devops)
0 commit comments