We have an app that acts like a layer in-between Azure Repos and the users. We are using a PAT of a service account, everything works properly except the voting, because we cannot vote on behalf of another user. Therefore we are investigating how to retrieve the specific user’s PAT.
I’ve tried generating a token with a powershell like: Connect-AzAccount -UseDeviceAuthentication
(Not sure what type of token is this) eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IktRMnRBY3JFN2xCYVZWR0JtYzVGb2JnZEpvNCIs…
Then I’m trying
curl --request POST
--url 'https://vssps.dev.azure.com/{ORGANIZATION}/_apis/tokens/pats?api-version=7.1-preview.1'
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IktRMnRBY3JFN2xCYVZWR0JtYzVGb2JnZEpvNCIs...'
--data '{
"displayName": "new_token",
"scope": "vso.tokens",
"validTo": "2024-12-01T23:46:23.319Z",
"allOrgs": false
}
'
But the tokens I created belong to the service account, I think. Is it possible to retrieve a PAT for an specific user? or how would be the flow to get the user’s PAT and let them vote? Thank you very much.