Personal Access Tokens expiration report #13
johnmbaughman
started this conversation in
General
Replies: 1 comment 1 reply
-
Thanks, @johnmbaughman for following me here! |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I recently found your Medium articles and GitHub repo and have been learning A LOT from this, so thank you!
I did have one issue with running the "tokenadmin/personalaccesstokens" API method. The code you have doesn't work when your DevOps instance is tied to an Azure Active Directory instance.
To get that to work, you need to Base64 encode the username and the PAT together separated by a colon ":". Example "[email protected]:MY_REGULAR_UNENCODED_PAT".
How I did it was like this:
$pat = "$(ConvertTo-Base64 -Value "$($Env:USERNAME)@company.com:$($env:AZURE_DEVOPS_EXT_PAT)" -Encoding ([Text.Encoding]::ASCII))"
Just thought I'd share that with you so that you could possibly update your example for future DevOps admins.
Thank you again for all of these AWESOME examples! They are quite useful!
-John
Beta Was this translation helpful? Give feedback.
All reactions