OAuth2 access token received from login.microsoftonline.com not working for on behalf of flow for azure devops api

antonio.mittielu 1 Reputation point
2020-08-14T15:22:19.413+00:00

Hi,

I registered an application in Azure Active Directory, granted permission to access Azure DevOps.

As I understand it is possible to use the access token that I got from login.microsoftonline.com to request another access token for Azure DevOps (https://learn.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-on-behalf-of-flow) but when I'm trying to do this I get this error: "AADSTS50027: JWT token is invalid or malformed". I can't understand why is this happening. I can use this token for other apis such as https://graph.microsoft.com/v1.0/users and it's working fine.

Am I missing someting? Maybe in application configuration?

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,464 questions
{count} votes