GitHub's PAT is recognized as a Token, not PersonalAccessToken
See original GitHub issueRequired Information
Type: Bug Task: GitHubRelease (v0/v1)
Environment
- Server - Azure Pipelines? Build link: https://dev.azure.com/ucfconsort/ucx/_build/results?buildId=1675&view=results
- Agent - Hosted (container):
Issue Description
I’m implementing release pipeline which should create a draft release on each tag pushed. I’ve created a PAT (admin:repo_hook, repo, user
permissions) and tried to create a release manually, it worked. Then I created a Service connection using this PAT. But when I run my pipeline, I’m getting this error:
The pipeline is not valid. Job release: Step GitHubRelease input gitHubConnection expects a service connection of type github with authentication scheme OAuth,PersonalAccessToken but the provided service connection release2 is of type github using authentication scheme Token.
I tried to ask on similar issue (#9394) but no answer.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:7
- Comments:12 (4 by maintainers)
Top Results From Across the Web
Personal Access Token not being accepted/recognised when ...
I created a Personal Access Token (PAT) on Github so that I could clone a repo for local access. When terminal asks for...
Read more >Chapter 9 Personal access token for HTTPS
With HTTPS, we will use a personal access token (PAT). ... Let it be known that the password that you use to login...
Read more >Help! Personal Access Tokens not working : r/github - Reddit
From prior experience, I know that you must give proper permissions to PAT (Personal Access Tokens). For example, if you would like whatever...
Read more >GitHub Personal Access Token not working
In SourceTree I open Preferences, click Accounts, click the GitHub account, click Edit and past the PAT into the password field. It appears...
Read more >Setting Up a Personal Access Token via R - The Carpentries
This error often means that you have your password stored in your keychain instead of your token. This seems like a weird error...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ok, I was able to solve the problem above by creating a personal access token. You can do so by following the instructions here. The minimal scope for the token can be:
Service Connections (Read, query, & manage)
. Be sure to click the “other 27 scopes” so this would appear.After creating the token you need to (1) base64 encode it and (2) copy-paste it in your request. In my case, I just used Postman rather than the usual
cURL
since the former does step 1 automatically. For Postman, simply go to the “Authorization” tab and fill-in your Username and Password (the generated token)Then for the request just go to Body, click the
raw
radio button. Then click the dropdown and change it from Text to JSON. You can then put the request as above (I’ll copy-paste it here for clarity):By clicking the Send command, you should be able to confirm that the Service Connection has been created properly:
Can also be found in my blog here: https://ljvmiranda921.github.io/notebook/2019/12/28/workaround-azure-github-pat/
@twpayne I created a Personal Access Token in Azure and used it with
curl
:Got smth like this as the final cmd:
curl -u USER:PAT -d '{"name": "release","type": "github","url": "https://github.com","authorization":{"scheme":"PersonalAccessToken","parameters":{"accessToken":"GITHUB_PAT"}}}' -H "Content-Type: application/json" -X POST 'https://dev.azure.com/{{ORG}}/{{PROJ}}/_apis/serviceendpoint/endpoints?api-version=5.1-preview'
Hope it helps.