Comment 0 for bug 1526566

Revision history for this message
Robert Bruce Park (robru) wrote : Wrong URL opens in browser when generating oauth token

Ok guys this one is real strange. Consider the following script:

http://bazaar.launchpad.net/+branch/cupstream2distro/view/head:/token_generator.py

(essentially trivial call to Launchpad.login_with() and explicitly using python2 due to bug 1526563).

When I run it, I get this output:

$ ./token_generator.py
The authorization page:
 (https://launchpad.net/+authorize-token?oauth_token=H17khGCRnvSzc10PzjZl&allow_permission=DESKTOP_INTEGRATION)
should be opening in your browser. Use your browser to authorize
this program to access Launchpad on your behalf.
Waiting to hear from Launchpad about your decision...

However the page that loads in my browser is just the truncated URL https://launchpad.net/+authorize-token?oauth_token=H17khGCRnvSzc10PzjZl which displays a 403.

If I then hover my mouse over that link in the terminal, the URL is correctly underlined (eg, including the allow_permission=DESKTOP_INTEGRATION and not including the parentheses, however if I right click (in gnome terminal) and choose "open link", STILL the wrong URL opens (same wrong URL, truncated at the &).

In order to make this work, I have to copy&paste the full URL, and then only when manually pasting the URL into the browser window does the page load correctly and allow me to authorize the token.

So quite strange behavior here, URL is being truncated, but I'm not sure by what or why. I guess firefox is doing it? It doesn't make sense that lplib script and gnome-terminal when clicking the link would both truncate in the same way (especially since gnome terminal underlines the correct url).

This is on xenial, with latest updates installed, using firefox as default browser.