Closed marceloavf closed 6 years ago
Is it possible to use an OAuth token instead of returning an error? What's the issue?
@onovotny, the library publish-release
that's used to do all comunication with GitHub API require a token to authenticate it, I would have to investigate what OAuth token return and send it to publish-release
instead of the normal token in the code below.
PRs are welcome! 🙌
https://github.com/marceloavf/github-tools-vsts/blob/24d167eff604393c38a3ac06db84ab523cfe7d98/Src/GithubReleasePublish/githubReleasePublish.js#L13-L14 https://github.com/remixz/publish-release/blob/master/index.js#L76
I believe that it's as "easy" as changing line 76 there from 'Authorization': 'token ' + opts.token,
to 'Authorization': 'Bearer ' + opts.token,
,
Plus whatever overload/config it'd need to support both methods. Like PAT, it's just another type of Authorization header.
You don't have to get your own token, you'd use the GitHub endpoint authorization endpoint for that. VSTS would have already taken care of getting the bearer token. There may be a parameter on the endpoint authorization that shows the type, in addition to AccessToken
I didn't notice that @onovotny, thanks for the details, so Bearer
can support both parameters?
I'll try to dig the documentation of EndpointAuthorization to see if it return more parameters, but I think it returns in other prop as you can see in #16
Would like this as well 👍
Working on it @tomkerkhove ✋ , meanwhile you can use token authentication!
Tested and verified ✔️ Thanks @marceloavf 🎉
Allow integration with OAuth authentication, not just Personal Access Token.
Endpoint:
Basic return
Error reference:
Case 1
Case 2
References: Code 1 Code 2 Code 3
Related to #16