Open iozcelik opened 4 years ago
@rmatejka I'm interested to know what happens if you uninstall the extension and try Visual Studio's built-in GitHub integration. See https://github.com/github/VisualStudio/issues/2521#issuecomment-795792333 for instructions.
Please let me know how you get on!
This has been opened since June 2020 and still isn't fixed? What a joke.
@rmatejka I'm interested to know what happens if you uninstall the extension and try Visual Studio's built-in GitHub integration. See #2521 (comment) for instructions.
Please let me know how you get on!
The same issue just different port: http://localhost:47120/?code=16a457fd323681d0dc61&state=fea7bdc119a44d77be40f99c4523b9e6
I finally determined what was causing this for me and how to fix it.
I frequently run my application server on localhost. My application is hard coded to send the Strict-Transport-Security
header even in debug mode (which it probably need not be). This causes Chrome to refuse to access the domain (i.e. localhost) except through SSL. It remembers this for the future, even when it's a different application on localhost. Thus the github integration hook, which apparently only uses HTTP, gets rejected by Chrome.
Easy solution - clear your browser history and cache (you don't have to clear cookies). And that's it.
Correct solution for Microsoft - run the hook through HTTPS.
I finally determined what was causing this for me and how to fix it.
I frequently run my application server on localhost. My application is hard coded to send the
Strict-Transport-Security
header even in debug mode (which it probably need not be). This causes Chrome to refuse to access the domain (i.e. localhost) except through SSL. It remembers this for the future, even when it's a different application on localhost. Thus the github integration hook, which apparently only uses HTTP, gets rejected by Chrome.Easy solution - clear your browser history and cache (you don't have to clear cookies). And that's it.
Correct solution for Microsoft - run the hook through HTTPS.
Thanks a ton, this works for me finally! BTW just clearing browser cache works, no need to clear history
Hi @KyuuzoT,
I'm sorry you've had such a hard time getting this to work!
There was another suggestion here #2527 (comment).
- Put this into Chrome address bar:
chrome://net-internals/#hsts
- Then go to the bottom and delete
localhost
from the Delete domain security policiesMight that the the issue?
This works for me
Works in Edge also.
edge://net-internals/#hsts
What worked for me was deleting all my cookies and browsing history (From Microsoft Edge Browser)
Note: Adding this comment here to provide more information (as already added into #2509 )
Hi Team,
Even I am facing this issue with GitHub extension with Visual Studio 2019. I have tried the above workarounds (uninstalling/reverting to previous version etc.) but no luck.
I am able to sign-in successfully to GitHub on my browser but through extension, when I click on 'Sign in with your browser' option, it opens the browser with the below URL and it just keeps loading: https://github.com/login/oauth/authorize?client_id=a200baed193bb2088a6e&scope=user%2Crepo%2Cgist%2Cwrite%3Apublic_key%2Cread%3Aorg%2Cworkflow&state=cd3677b8-bf82-4d2d-80c2-71fb3ed7cb63
Below is the error captured from Github Extension log:
2020-08-15 22:29:05.832 [20420] INFO [58] GitHubPackage Initializing GitHub Extension v2.11.104.25275 in Microsoft Visual Studio 2019 (16.6.30114.105) 2020-08-15 22:29:23.860 [20420] EROR [01] LoginTabViewModel Error logging into '"https://github.com/"' as '' Octokit.AuthorizationException: Requires authentication at Octokit.Connection.HandleErrors(IResponse response) at Octokit.Connection.d58.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Octokit.Connection.d57
1.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at GitHub.Api.LoginManager.<GetUserAndCheckScopes>d__23.MoveNext() in D:\a\VisualStudio\VisualStudio\src\GitHub.Api\LoginManager.cs:line 346 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at GitHub.Api.LoginManager.<ReadUserWithRetry>d__22.MoveNext() in D:\a\VisualStudio\VisualStudio\src\GitHub.Api\LoginManager.cs:line 335 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at GitHub.Api.LoginManager.<LoginViaOAuth>d__14.MoveNext() in D:\a\VisualStudio\VisualStudio\src\GitHub.Api\LoginManager.cs:line 158 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at GitHub.VisualStudio.ConnectionManager.<LogInViaOAuth>d__14.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at GitHub.ViewModels.Dialog.LoginTabViewModel.<LoginToHostViaOAuth>d__56.MoveNext() in D:\a\VisualStudio\VisualStudio\src\GitHub.App\ViewModels\Dialog\LoginTabViewModel.cs:line 173 {"message":"Requires authentication","documentation_url":"https://docs.github.com/rest/reference/users#get-the-authenticated-user"} 2020-08-15 22:31:05.818 [20420] EROR [05] GitHubServiceProvider Error loading GitHub.Services.IConnectionManager System.InvalidOperationException: Due to high risk of deadlock you cannot call GetService from a background thread in an AsyncPackage derived class. You should instead call GetServiceAsync (without calling Result or Wait on the resultant Task object) or switch to the UI thread with the JoinableTaskFactory.SwitchToMainThreadAsync method before calling GetService. at Microsoft.VisualStudio.Shell.AsyncPackage.GetService(Type serviceType) at Microsoft.VisualStudio.Shell.Package.System.IServiceProvider.GetService(Type serviceType) at GitHub.VisualStudio.GitHubServiceProvider.TryGetService(Type serviceType) 2020-08-15 22:34:32.192 [20420] EROR [01] LoginTabViewModel Error logging into '"https://github.com/"' as '' Octokit.AuthorizationException: Requires authentication at Octokit.Connection.HandleErrors(IResponse response) at Octokit.Connection.<RunRequest>d__58.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Octokit.Connection.<Run>d__57
1.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at GitHub.Api.LoginManager.d23.MoveNext() in D:\a\VisualStudio\VisualStudio\src\GitHub.Api\LoginManager.cs:line 346 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at GitHub.Api.LoginManager.d22.MoveNext() in D:\a\VisualStudio\VisualStudio\src\GitHub.Api\LoginManager.cs:line 335 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at GitHub.Api.LoginManager.d14.MoveNext() in D:\a\VisualStudio\VisualStudio\src\GitHub.Api\LoginManager.cs:line 158 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at GitHub.VisualStudio.ConnectionManager.d14.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at GitHub.ViewModels.Dialog.LoginTabViewModel.d__56.MoveNext() in D:\a\VisualStudio\VisualStudio\src\GitHub.App\ViewModels\Dialog\LoginTabViewModel.cs:line 173 {"message":"Requires authentication","documentation_url":"https://docs.github.com/rest/reference/users#get-the-authenticated-user"}
You can try 3 things for this issue
You can try 3 things for this issue
try with Administrator mode of visual studio. download latest git credentials manager add //.vs//DesignTimeBuild/.dtbcache.v2 to git ignore
Lool después de haber luchado durante años ... He encontrado una solución a esto El curso es. Primero uso mi Google Chrome con el que guardé mi cuenta de Github. Entonces, mi VS me estaba llevando a Microsoft Edge y desactivaba el botón.
Todo lo que tiene que hacer es cambiar su navegador predeterminado en su máquina al que ha firmado en github
Gracias!!! soluciones mi problema!!
I finally determined what was causing this for me and how to fix it.
I frequently run my application server on localhost. My application is hard coded to send the
Strict-Transport-Security
header even in debug mode (which it probably need not be). This causes Chrome to refuse to access the domain (i.e. localhost) except through SSL. It remembers this for the future, even when it's a different application on localhost. Thus the github integration hook, which apparently only uses HTTP, gets rejected by Chrome.Easy solution - clear your browser history and cache (you don't have to clear cookies). And that's it.
Correct solution for Microsoft - run the hook through HTTPS.
Thank you very much. I got the issue finally resolved with your suggestion. Well done!
I finally determined what was causing this for me and how to fix it. I frequently run my application server on localhost. My application is hard coded to send the
Strict-Transport-Security
header even in debug mode (which it probably need not be). This causes Chrome to refuse to access the domain (i.e. localhost) except through SSL. It remembers this for the future, even when it's a different application on localhost. Thus the github integration hook, which apparently only uses HTTP, gets rejected by Chrome. Easy solution - clear your browser history and cache (you don't have to clear cookies). And that's it. Correct solution for Microsoft - run the hook through HTTPS.Thank you very much. I got the issue finally resolved with your suggestion. Well done!
Thank you, this resolved the issue.
Hi @KyuuzoT,
I'm sorry you've had such a hard time getting this to work!
There was another suggestion here #2527 (comment).
- Put this into Chrome address bar:
chrome://net-internals/#hsts
- Then go to the bottom and delete
localhost
from the Delete domain security policiesMight that the the issue?
Thanks this solution resolve my problem
None of the proposed solutions seem to solve the problem for me. It hangs attempting to reach localhost - it doesn't seem to to listening for incoming requests.
I never had a problem logging in, now I have. It was so much that I had to delete the chrome browsing history. solved
The issue that I was facing was that github was redirecting me to localhost without adding the port number. http://localhost/?browser_session_id=96cee3401f9a78b6f307eb0819606d4f80e21988a8a945fb6d3b9b74e032de8e&code=90255ccef1a34eac35cb&state=189a50d1-b1ae-405d-8b46-ecf54e3528a1
I just added the port number as mentioned in ttaylor29 (42549) comment and it worked fine then.
The issue that I was facing was that github was redirecting me to localhost without adding the port number. http://localhost/?browser_session_id=96cee3401f9a78b6f307eb0819606d4f80e21988a8a945fb6d3b9b74e032de8e&code=90255ccef1a34eac35cb&state=189a50d1-b1ae-405d-8b46-ecf54e3528a1
I just added the port number as mentioned in ttaylor29 (42549) comment and it worked fine then.
I can say that this fixed my issue as well.
changed localhost to localhost:42549 and it connected without an further issue.
The issue that I was facing was that github was redirecting me to localhost without adding the port number. http://localhost/?browser_session_id=96cee3401f9a78b6f307eb0819606d4f80e21988a8a945fb6d3b9b74e032de8e&code=90255ccef1a34eac35cb&state=189a50d1-b1ae-405d-8b46-ecf54e3528a1 I just added the port number as mentioned in ttaylor29 (42549) comment and it worked fine then.
I can say that this fixed my issue as well.
changed localhost to localhost:42549 and it connected without an further issue.
This fix my issue, but, how can we map the port to automatically open in GitHub sign-In with browser for visual studio?
The issue that I was facing was that github was redirecting me to localhost without adding the port number. http://localhost/?browser_session_id=96cee3401f9a78b6f307eb0819606d4f80e21988a8a945fb6d3b9b74e032de8e&code=90255ccef1a34eac35cb&state=189a50d1-b1ae-405d-8b46-ecf54e3528a1 I just added the port number as mentioned in ttaylor29 (42549) comment and it worked fine then.
I can say that this fixed my issue as well.
changed localhost to localhost:42549 and it connected without an further issue.
worked for me also
Fixed 42549 my issue THnks
I found a workaround that worked for me. (update: it just looked like it authorized but did not)
from GitHub website repository : Open with visual studio.
A popup on visual studio should appear to login.
Select the option to sign in with code.
Enter the code into the webpage that opens and authorize Visual Studio.
Never mind it just looked like it worked. the above comment solution worked (adding port 42549 to localhost)
The issue that I was facing was that github was redirecting me to localhost without adding the port number. http://localhost/?browser_session_id=96cee3401f9a78b6f307eb0819606d4f80e21988a8a945fb6d3b9b74e032de8e&code=90255ccef1a34eac35cb&state=189a50d1-b1ae-405d-8b46-ecf54e3528a1
I just added the port number as mentioned in ttaylor29 (42549) comment and it worked fine then.
This is fixed my issue. Thanks
The issue that I was facing was that github was redirecting me to localhost without adding the port number. http://localhost/?browser_session_id=96cee3401f9a78b6f307eb0819606d4f80e21988a8a945fb6d3b9b74e032de8e&code=90255ccef1a34eac35cb&state=189a50d1-b1ae-405d-8b46-ecf54e3528a1
I just added the port number as mentioned in ttaylor29 (42549) comment and it worked fine then.
Thank you - worked for me also.
This happened to me as well. I tried different things from this and other threads and nothing worked. Firefox was the only browser taking me to GitHub login so I changed my default browser to Firefox so it would open from VS. It worked and logged me in. Maybe helpful to try the link in different browsers to find which one actually opens the site.
In my case I had an issue with hsts as edge and chrome were trying ot use https to redirect to localhost. I just went to edge://net-internals/#hsts within edge and under Delete domain security policies I typed localhost. Then I retried logging in with VS and the authentication was successful.
In my case I had an issue with hsts as edge and chrome were trying ot use https to redirect to localhost. I just went to edge://net-internals/#hsts within edge and under Delete domain security policies I typed localhost. Then I retried logging in with VS and the authentication was successful.
This is the solution that works for me too.
Versions
What happened
Steps to Reproduce
Steps to reproduce the behavior:
Expected behavior
Open to a github.com adress
Screenshots