You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
"Sign in using your browser" doesn't work with AppImage #10
When prompted to sign in to the app, the "Sign in using your browser" option doesn't work.
Version
GitHub Desktop version: 1.0.11
OS version: Ubuntu 16.04.3
Steps to Reproduce
Launch the app for the first time
Press buttons until you can choose to sign in in a browser, and do so
Go through the OAuth prompts
Finish the OAuth prompts, and the redirect to the app doesn't work – you get prompted (by Chrome) to open xdg-open, but the webpage doesn't close, and the GitHub app just sits there with the loading spinner until you press Cancel.
Expected behavior: Signing in through a browser should work
Actual behavior: The redirect back to the app doesn't work
Reproduces how often: Presumably always, at least when using the AppImage
Logs
Can't find these on Linux, will happily provide if someone tells me where they are
This is an old Electron issue electron/electron#6440 and it looks like it will be available in 1.8.2 electron/electron#10670 (we're on 1.7.9, but 1.8.x is a major Chromium update for us which we usually do with caution to ensure a smooth transition for users).
We're currently testing updating Electron to 1.8.2 in Desktop in this PR, so once that is merged I'll prepare a new build and confirm this is resolved.
Just tested this in Mint using bump-electron and while it will open up my browser (this is an improvement), it won't attempt to start the auth process. If my browser is open, it starts the auth process but never completes.
@iAmWillShepherd to troubleshoot further, do you see this code being invoked at all when the app is running - probably needs logging as this is in the main process. Maybe a different set of args is being passed to the app and it's not handling them correctly?
functionhandleAppURL(url: string){log.info(`handeledAppUrl::url - ${url}`)log.info('Processing protocol url')constaction=parseAppURL(url)onDidLoad(window=>{// This manual focus call _shouldn't_ be necessary, but is for Chrome on// macOS. See https://github.com/desktop/desktop/issues/973.window.focus()window.sendURLAction(action)})}
☝️ never get's called for me. I also pulled in the latest changes from master and tried again. No luck.
We've just released 1.1.1 which is based on Electron 1.8.3, so I'd like to figure out what additional work we need to do in the application to support the protocol handler that Electron should be registering correctly on Linux now...
This sounds similar to what I just experienced after using the GitHubDesktop-linux-amd64-1.1.1.deb installer.
Summary
When authenticating with oauth & GitHub, Firefox isn't sure what to do with the x-github-client protocol. GitHub Desktop seems to wait (the login spinner spins) for a response (which never gets sent out)
Steps to Reproduce
Launch the app for the first time
Press buttons until you can choose to sign in in a browser, and do so
Go through the OAuth prompts
Confirm password
See the following message from firefox with x-github-client://oauth?code=my_oauth_code as the url
The address wasn’t understood
Firefox doesn’t know how to open this address, because one of the following protocols (x-github-client) isn’t associated with any program or is not allowed in this context.
You might need to install other software to open this address.
Expected Behavior: Github Desktop tells me that I've successfully logged in
Actual Behavior: Github Desktop stays in a state with a spinning Sign In button.
Browser: Firefox 59.0.2 (64-bit) OS: Ubuntu Desktop 17.10 GitHub Desktop: 1.1.1
It may be a an issue with the OS/Browser figuring out what to do with x-github-client as the protocol.
Workaround
Just sign in using the email & password boxes in GitHub Desktop
How is Firefox supposed to know what to do with x-github-client://? Possibly the launcher script in the AppImage would have to copy a little helper file somewhere to "teach" Firefox what to do with this URL?
The app protocols need to be added to script/electron-builder-linux.yml. In electron-packager the protocols are only used for mapping to CFBundleURLSchemes. Meanwhile the protocols in the electron-builder config are used to add the MimeType entry to the app's desktop file.
Meanwhile the protocols in the electron-builder config are used to add the MimeType entry to the app's desktop file.
Got an example of this that I can adapt? The AppImage options listed in the docs don't seem to mention it, and it sounds like an easy change to introduce and validate especially if it's just related to desktop entries.
I've had some time to poke into this, and before I go and try to upstream this or put together a new build could someone sanity check that this change?
You will probably need to run the optional appimaged daemon if you want desktop integration, such as associating MimeType=x-scheme-handler/x-github-client;x-scheme-handler/x-github-desktop-auth; to your AppImage.
Activity
shiftkey commentedon Dec 14, 2017
This is an old Electron issue electron/electron#6440 and it looks like it will be available in 1.8.2 electron/electron#10670 (we're on
1.7.9, but1.8.xis a major Chromium update for us which we usually do with caution to ensure a smooth transition for users).theel0ja commentedon Feb 27, 2018
Same issue with .deb version
shiftkey commentedon Feb 27, 2018
We're currently testing updating Electron to 1.8.2 in Desktop in this PR, so once that is merged I'll prepare a new build and confirm this is resolved.
iAmWillShepherd commentedon Feb 28, 2018
Just tested this in Mint using
bump-electronand while it will open up my browser (this is an improvement), it won't attempt to start the auth process. If my browser is open, it starts the auth process but never completes.shiftkey commentedon Feb 28, 2018
@iAmWillShepherd to troubleshoot further, do you see this code being invoked at all when the app is running - probably needs logging as this is in the main process. Maybe a different set of args is being passed to the app and it's not handling them correctly?
iAmWillShepherd commentedon Mar 1, 2018
☝️ never get's called for me. I also pulled in the latest changes from master and tried again. No luck.
shiftkey commentedon Mar 27, 2018
We've just released
1.1.1which is based on Electron 1.8.3, so I'd like to figure out what additional work we need to do in the application to support the protocol handler that Electron should be registering correctly on Linux now...ThomasThelen commentedon Apr 14, 2018
This sounds similar to what I just experienced after using the
GitHubDesktop-linux-amd64-1.1.1.debinstaller.Summary
When authenticating with oauth & GitHub, Firefox isn't sure what to do with the
x-github-clientprotocol. GitHub Desktop seems to wait (the login spinner spins) for a response (which never gets sent out)Steps to Reproduce
x-github-client://oauth?code=my_oauth_codeas the urlExpected Behavior: Github Desktop tells me that I've successfully logged in
Actual Behavior: Github Desktop stays in a state with a spinning
Sign Inbutton.Browser: Firefox 59.0.2 (64-bit)
OS: Ubuntu Desktop 17.10
GitHub Desktop: 1.1.1
It may be a an issue with the OS/Browser figuring out what to do with
x-github-clientas the protocol.Workaround
Just sign in using the email & password boxes in GitHub Desktop
probonopd commentedon Apr 14, 2018
How is Firefox supposed to know what to do with
x-github-client://? Possibly the launcher script in the AppImage would have to copy a little helper file somewhere to "teach" Firefox what to do with this URL?shiftkey commentedon Apr 14, 2018
Some extra context on this:
Electron is invoking
xdg-settingsto associate the running app with a given protocol. The source for that is here.I'm also pretty sure that Firefox uses XDG to resolve these protocol handlers: https://superuser.com/questions/162092/how-can-i-register-a-custom-protocol-with-xdg
However I can't seem to validate this worked for Desktop
v1.1.1on my Ubuntu VM - this command doesn't emit any output:$ xdg-settings get default-url-scheme-handler x-github-clientI also get the exact same error from Firefox when trying to complete the auth flow.
ascendancyy commentedon Jun 15, 2018
The app protocols need to be added to
script/electron-builder-linux.yml. Inelectron-packagerthe protocols are only used for mapping toCFBundleURLSchemes. Meanwhile the protocols in theelectron-builderconfig are used to add theMimeTypeentry to the app's desktop file.shiftkey commentedon Jun 15, 2018
@ascendancyy
Got an example of this that I can adapt? The AppImage options listed in the docs don't seem to mention it, and it sounds like an easy change to introduce and validate especially if it's just related to
desktopentries.ascendancyy commentedon Jun 15, 2018
@shiftkey
It's a top level key - the same values from here.
shiftkey commentedon Aug 12, 2018
I've had some time to poke into this, and before I go and try to upstream this or put together a new build could someone sanity check that this change?
Generating this
desktop.desktopfile for the.debfile:is what we're expecting to address the issue. @ascendancyy does this seem right?
ascendancyy commentedon Aug 14, 2018
@shiftkey looks good to me
j-f1 commentedon Dec 17, 2018
Same issue with the
.debinstaller on Debian on the Chromebook.shiftkey commentedon Dec 21, 2018
#110 will fix this for the Debian package, but I don't see this working for AppImage.
The installer seems to have the right
.desktopcontents:It's just that Firefox doesn't seem to care about it when you complete the browser login flow. For those who want this support I think you'll have to do something like this to connect the AppImage up to your browser: https://askubuntu.com/questions/819782/how-do-i-associate-a-file-type-with-an-appimage
probonopd commentedon Dec 21, 2018
You will probably need to run the optional appimaged daemon if you want desktop integration, such as associating
MimeType=x-scheme-handler/x-github-client;x-scheme-handler/x-github-desktop-auth;to your AppImage.shiftkey commentedon Dec 21, 2018
@probonopd today I learned! Thanks for that clue - if it comes up again down the track I'll see about getting some better guidance for it.