Problem Statement: I'm trying to create a module in C# console application that I intend to plug and use in Azure Bot once it is operational. I want to connect my bot with Azure DevOps. I am able to do that with PAT token but I need the bot to only display the resources from DevOps on which the logged in user has access.
Attempts:
- I am able to get the necessary details using PAT token. It gives me all projects irrespective of the logged in user details.
- I have tried to use the Azure AD token for the logged in user but it gives me unauthorized error on trying to use it to invoke Azure DevOps REST APIs
- Referred this article but I am unable to get the auth code or token silently.
To summarize, I'm basically looking to:
- Obtain a user token for Azure DevOps silently (without user confirming with a click)
- Use REST APIs to fetch details like projects, work items etc.