question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Redirect after browser authentication does not open application

See original GitHub issue

Describe the bug

Authentication using the browser does not return to the application because it uses an unregistered mime-type scheme by the application.

Version & OS

  • Source: GitHubDesktop-linux-2.5.3-linux1.deb
  • Version: 2.1.0-linux1
  • OS: Linux Mint 20 Cinnamon | Cinnamon v4.6.6 | Linux Kernel 5.4.0-42-generic | 64bits
  • Processor: AMD A10-7860K Radeon R7, 12 Compute Cores 4C+8G × 2
  • Tested Browsers: Chrome 84.0.4147.105 | Firefox 79.0

Steps to reproduce the behavior

  1. Download package from GitHubDesktop-linux-2.5.3-linux1.deb and install
  2. Open application and go to: “Sign in to GitHub.com” (button) or File > Options > Accounts and sign in “GitHub.com” with “Sign in using your browser
  3. Sign in to GitHub.com if you have not done so before … authorize the application and confirm using username/email and password or use the security key

Expected behavior

In https://github.com/login/oauth/authorize is expected to redirect to the application through its own protocol (x-github-desktop-dev-auth) that the application must recognize.

Actual behavior

The redirect does not occur after confirming the “xdg-open” prompt … the application does not recognize the schema.

x-github-desktop-dev-auth://oauth?code=xxxxxxxxxxxxxxxxxxxxx&state=yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy

Screenshots

github-005 github-006

Additional context

This behavior has been observed in new installations on both Linux Mint 19.3 and 20.

When viewing the application’s “github-desktop.desktop” file, the protocol used in the browser was missing from the MimeTypes list of the file.

github-007

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
subversivo58commented, Aug 4, 2020

Palliative editing of the github-desktop.desktop file and adding the schema mime-type used in the redirect and updating the mime-type database solves the problem and in future attempts, the redirection returns to the application.

Steps:

1- Open /usr/share/applications/github-desktop.desktop with the text editor of your choice

sudo -H subl /usr/share/applications/github-desktop.desktop

2 - Add the scheme (“x-scheme-handler/x-github-desktop-dev-auth;”) in the “MimeType” list and save

[Desktop Entry]
Name=GitHub Desktop
Comment=Simple collaboration from your desktop
Exec="/opt/GitHub Desktop/github-desktop" %U
Terminal=false
Type=Application
Icon=github-desktop
StartupWMClass=GitHub Desktop
MimeType=x-scheme-handler/x-github-client;x-scheme-handler/x-github-desktop-auth;x-scheme-handler/x-github-desktop-dev-auth;
Categories=GNOME;GTK;Development;

3 - Update mime types database

sudo update-desktop-database 

4 - Redo the authentication by the browser … now the redirect should open the application completing the authorization


Note: after performing steps 1 to 3, it is no longer possible to reproduce the problem even if you uninstall and reinstall the package.

0reactions
shiftkeycommented, Dec 17, 2020

I’m going to close this out as I think I’ve configured everything right in the Debian installer as of version 2.4.1-linux2

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to redirect to a login page, but only when the browser is ...
It feels like the Accept header should be my guide in this, but I need this to work even if the user has...
Read more >
[Question] Redirect from browser after web auth doesn't happen
Steps to reproduce: Call auth.webAuth.authorize() . Browser with a hosted login page opens. Perform authentication. Expected behavior:
Read more >
When logging into desktop app, doesn't redirect back to app ...
When logging in to the the Asana app it directs us to the browser to login using SSO. However, we are not being...
Read more >
738724 - Chrome tabs not redirecting back to app without user ...
External auth app does its thing and redirects back to the open page with the "redirect back url" which makes the browser "resume...
Read more >
Redirect Users - Auth0
Describes how to redirect users to URLs that have not been added to the AllowList. ... your application after validating their ID Tokens...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found