Auth requests not handled correctly

I am running ubuntu 17.10

When I click on any 'sign in with blockstack` button, the behavior does not work as expected.

On my work desktop (ubuntu 16.04) I am redirected to localhost:8888 with the auth request. and i am able to approve and it works.

However, on 17.10 , It opens a new chrome window with a blank address bar.

The previously focused window does however contain the auth in the URL.

So I am able to manually copy the /auth/blahblahblah and manually go to localhost:8888 and paste that code in there.

Hey @paOol, sorry to hear that!

The Blockstack installer adds a protocol handler for blockstack:, and uses xdg-open to load your preferred browser to handle blockstack: URLs. It does so via this .desktop file, installed to your ~/.local/share/applications/ directory:

[Desktop Entry]
Type=Application
Terminal=false
Exec=bash -c 'xdg-open http://localhost:8888/auth?authRequest=\$(echo "%u" | sed s/blockstack://)'
Name=Blockstack-Browser
MimeType=x-scheme-handler/blockstack;

Can you confirm that this file is present, and that you have xdg-open in your $PATH?

.local/share/applications                                                                               ⍉
▶ cat blockstack.desktop 
[Desktop Entry]
Type=Application
Terminal=false
Exec=bash -c 'xdg-open http://localhost:8888/auth?authRequest=$(echo "%u" | sed s/blockstack://)'
Name=Blockstack-Browser
MimeType=x-scheme-handler/blockstack;

I am using ZSH and oh-my-zsh as my shell.
I added this line and sourced, but getting the same behavior.

export BROWSER=xdg-open

It’s actually possible to have the blockstack: protocol in the authRequest now, so you can just change the Exec line to:

Exec=xdg-open http://localhost:8888/auth?authRequest=%u

I might send a new pull request reverting that bash hack.

I have replaced that line and the behavior is still the same.

If it helps, when i do Blockstack.sh start
it doesn’t automatically open the window either.

Does xdg-open http://aoeu.com bring up the browser correctly? If not then you probably have to fix your xdg-open.

Edit: removed irrelevant do-it-manually suggestion as you already did that, and this thread is to get the nicer version working :wink:

xdg-open does open correctly.

I am using i3wm if it matters.
On ubuntu 17.10

issue still happens on the latest release.

I read somewhere to make changes to the defaults.list

this is what mine currently looks like

[Default Applications]
video/x-msvideo=org.gnome.Totem.desktop;svp-manager4.desktop
video/x-matroska=org.gnome.Totem.desktop;svp-manager4.desktop
video/webm=org.gnome.Totem.desktop;svp-manager4.desktop
video/mpeg=org.gnome.Totem.desktop;svp-manager4.desktop
video/mp4=org.gnome.Totem.desktop;svp-manager4.desktop

would i need to paste the contents of blockstack.desktop or would it I need to add an entry more like

Blockstack-Browser=Exec=xdg-open blah blah blah

In your case, can you try adding x-scheme-handler/blockstack=Exec=xdg-open blah blah blah to your [Default Applications]?

added Blockstack-Browser=blockstack.desktop;

and getting the same behavior.

same with x-scheme-handler/blockstack=xdg-open http://localhost:8888/auth?authRequest=%u;

not sure if this helps, but this is the output of running sensible-browser

▶ sensible-browser 
ATTENTION: default value of option force_s3tc_enable overridden by environment.
[19900:19939:1110/230750.840928:ERROR:browser_gpu_channel_host_factory.cc(108)] Failed to launch GPU process.
Created new window in existing browser session.