Search code examples
azure-devopsoauth-2.0pkce

Azure DevOps REST API Authentication with PKCE


Does Azure DevOps REST API support OAuth 2 authentication with PKCE? The documentation page does not explicitly mention anything about PKCE but I'm wondering if it's just not there yet documented but already supported.


Solution

  • This doc uses the Azure DevOps App to do the OAuth 2.0 authentication, not sure if it supports the PKCE, you may need to have a try.

    But another way to auth Azure DevOps REST API which is Azure AD auth code flow, supports PKCE, you need to register the azure ad app in the azure portal, add the Azure DevOps permission, see here. Then use the Azure AD auth code flow with PKCE to get the token and use the token to call the API. Remember to change the scope to 499b84ac-1321-427f-aa17-267ca6975798/.default.