Steps to Reproduce:
We ran into the same issue. While troubleshooting we discovered a couple of things:
1) I could get rid of the 404 if I created an OAuth app under my account with https://github-editor-auth.herokuapp.com as the callback URL. I then replaced the clientId in the URL that Code opens up when signing in with the clientId for my new app. Boom no more 404! Unfortunately auth still fails likely because it doesn't know the clientSecret of my app :(
2) When trying the workaround specified in https://github.com/Microsoft/vscode-pull-request-github/issues/384#issuecomment-419993453 I found that it worked just fine for forked repos under user accounts but it did not work for any repos under our org. I tried both with the specific grants as well as the ALL THE THINGS grant and had the same results - trying to load data from any repo in our org resulted in a Not Authenticated error. Are there are specific org-wide permissions that need to be enabled for this extension to work?
Note all this was tested locally using vsce to package the latest code from master ( specifically for #411 )
When I try the workaround specified in #384, after closing and reopening VSCode my settings.json is updated to remove the token from github.hosts (leaving just the host URL) and it asks me to sign in.
I got the same issue when connecting my Github Enterprise account. Pls keep us posted if there is any workaround or fix. I would use the extension because it seems be useful.
Thanks.
Exactly same issue here. I got the link below when I saw 400, replace IDs with _XXXX_
I've found a way to work around the token disappearing issue. Go through the sign-in process like normal and let it fail. After it fails go into your settings.json and setup your hosts:
"github.hosts": [
{
"host": "https://your.host.here",
"username": "your.username",
"token": "yourtoken"
}
]
Make sure to use your GHE username and not oauth as the comment recommends. Then go into the SCM tab and refresh your PRs and you should be good to go.
This should work for multiple hosts as well if you have to connect to multiple GHE instances.
Thanks @ultimatemonty for the workaround. I got my plugin working by creating a new token (at https://your.host.here/settings/tokens) with the following permission: read:user, repo, user:email, write:discussion. Got these permission from the queries of 404 request (original: scope=read%3Auser%20user%3Aemail%20repo%20write%3Adiscussion)
I've found a way to work around the token disappearing issue. Go through the sign-in process like normal and let it fail. After it fails go into your settings.json and setup your hosts:
"github.hosts": [ { "host": "https://your.host.here", "username": "your.username", "token": "yourtoken" } ]Make sure to use your GHE username and _not_
oauthas the comment recommends. Then go into the SCM tab and refresh your PRs and you should be good to go.This should work for multiple hosts as well if you have to connect to multiple GHE instances.
This doesn't work for me. The username and token attribute get automatically removed every time I save the setting file.
Thanks @ultimatemonty for the workaround. I got my plugin working by creating a new token (at https://your.host.here/settings/tokens) with the following permission:
read:user,repo,user:email,write:discussion. Got these permission from the queries of 404 request (original:scope=read%3Auser%20user%3Aemail%20repo%20write%3Adiscussion)
This works for me! thanks for identifying the scope in the workaround
i did not see the scope write:discussion, is it because GHE admin turned it off or simply GHE version thing? mine is GitHub Enterprise 2.11.18
Thanks to @ultimatemonty and @reverbc. I got mine working, but I did have to restart VS Code. Great extension.
@lukefan6 It's too old. Enterprise 2.11.x is deprecated and contains serious unpatched security vulnerabilities. Request your administrator to upgrade as soon as possible.
Tried creating the personal token manually as @reverbc mentioned but did not have the write:discussion scope available as @lukefan6 described. Did not bypass login and instead still get the 404 error on pressing continue on the herokuapp.com page. GHE Version is 2.12.
@ultimatemonty @reverbc These solution solved my issue.
GHE 2.14
The versions of GHE that support signing in with the Sign In popup are:
Other versions will need a personal access token configured with the scopes read:user, repo, user:email, write:discussion, as mentioned above.
i did not see the scope
write:discussion, is it because GHE admin turned it off or simply GHE version thing? mine is GitHub Enterprise 2.11.18
Oh this is a good point, some versions of GHE might not have this scope available, in which case the personal token might fail. I think we can ease restrictions on the scope validation for this so it won't fail (write:discussion is not essential at this time).
@shana Ah the patch version makes all the difference. Thank you
The wiki has updated instructions on how to sign in to GitHub Enterprise, check them out at https://github.com/Microsoft/vscode-pull-request-github/wiki#2-is-github-enterprise-supported!
If you're still having problems, please open a new issue with the details
Most helpful comment
Thanks @ultimatemonty for the workaround. I got my plugin working by creating a new token (at https://your.host.here/settings/tokens) with the following permission:
read:user,repo,user:email,write:discussion. Got these permission from the queries of 404 request (original:scope=read%3Auser%20user%3Aemail%20repo%20write%3Adiscussion)