Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Oauth2 login not working on old Android #20018

Open
dfandrich opened this issue Jun 5, 2024 · 7 comments
Open

Oauth2 login not working on old Android #20018

dfandrich opened this issue Jun 5, 2024 · 7 comments
Labels
Observed Needs more clarification, feedback, or research

Comments

@dfandrich
Copy link

Description

The oauth2 login flow does not work on an old Android 7.1.2 phone running LineageOS 14.1. The web browser opens, OSM login credentials are entered, then the browser appears to redirect to a URL osmand-oauth://osmand.net/?code=XXX and displays the message:

Web page not available
The web page at osmand-oauth://osmand.net/?code=XXX could not be loaded because:

net::ERR_UNKNOWN_URL_SCHEME

Needless to say, OSM authorization was not been set in OSMand. The web browser in use is not Chrome but rather the Lineage default Browser application org.lineageos.jelly ver. 7.1.2. There was no issue with the oauth1 flow on this OS (which I haven't done in a couple of years).

I tried manually running adb shell am start -a android.intent.action.VIEW -d 'osmand-oauth://osmand.net/?code=XXX' but it returned the message

Starting: Intent { act=android.intent.action.VIEW dat=osmand-oauth://osmand.net/?code=XXX }
Warning: Activity not started, its current task has been brought to the front

and while OSMand came to the foreground on the phone this time, it seemed to ignore the authorization code.
I don't think this is related to the improper oauth2 scope issue mentioned in #19966 (comment) because it's clearly an issue with the integration between browser and application.

Steps to reproduce

Choose Login to OpenStreetMap and follow the Sign in with OpenStreetMap flow.

Actual result

net::ERR_UNKNOWN_URL_SCHEME

Expected result

OSM is seamlessly authorized in OSMand

Your Environment (required)

OsmAnd Version: 4.7.10
Android/iOS version: 7.1.2
Device model: Nexus 5/hammerhead
Crash-Logs: n/a
@DmitryAlexei
Copy link
Contributor

@dfandrich

  • could you provide your browser version and a screenshot with the error
  • please try to open https://osmand.net/map / - and check whether the app or web version will be loaded
  • could you also install Chrome as the default browser and see if it is working with it?

@dfandrich
Copy link
Author

dfandrich commented Jun 8, 2024

The browser version is 7.1.2 as in my original report. I don't have Google Play configured on this device so installing Chrome might not be straightforward. Here's a screenshot of the error screen (@maltfield, can you confirm this is what you're seeing, too?):

@yuriiurshuliak
Copy link

The bug could not be reproduced. I attempted to reproduce the issue by logging in through the "Sign in with OpenStreetMap" button. The web browser opened, I successfully logged into OpenStreetMap, and my account was displayed in the app.

Please ensure you are using the official version of the app and let us know if the error continues. Alternatively, you can try logging in using the "Use username and password" button.

OsmAnd~ 4.8.0#2460m, released: 2024-06-08
Version : 12

video_2024-06-08_13-52-10.mp4

@dfandrich
Copy link
Author

I'm using the OSM version on F-Droid. The "Use username & password" option works as a workaround, but a comment in #20017 leads me to believe that won't be working for long. What browser do you have as default? I suspect that's related.

@vshcherb vshcherb added the Observed Needs more clarification, feedback, or research label Jun 10, 2024
@dfandrich
Copy link
Author

I missed the request earlier to try https://osmand.net/map/ from my browser. That site, indeed, loads and works fine.

@dfandrich
Copy link
Author

As an experiment, I installed the monocles browser from F-Droid, a small, System WebView-based (I believe) alternative browser. After setting it as the default browser, starting the OAuth2 authentication flow from OSMand once more, then enabling cookies in the browser before logging in, it succeeded. I could then uninstall monocles and continue using the OAuth2 credentials.

So, this seems a usable workaround for those suffering from this issue.

@maltfield
Copy link

If this bug exists with some browsers, then I think users should be able to copy and paste the keys directly between our own browser and the app.

OsmAnd should have some "manually enter keys" option, and documentation should describe how to use this if the browser <--> OsmAnd connection is broken.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Observed Needs more clarification, feedback, or research
Projects
None yet
Development

No branches or pull requests

5 participants