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

Login fails with FoursquareInternalErrorException: net::ERR_CLEARTEXT_NOT_PERMITTED if Foursquare app is installed. #17

Open
francais-harry opened this issue Jul 14, 2020 · 0 comments

Comments

@francais-harry
Copy link

francais-harry commented Jul 14, 2020

Environment:
Library version: com.foursquare:foursquare-android-oauth:1.1.0
Foursquare app version: 11.17.1
Android 10 Pixel 4XL

Prerequisites

Step by step

  1. App calls startActivityForResult with intent from FoursquareOAuth.getConnectIntent
  2. Foursquare app comes to foreground, then close immediately.
  3. onActivityResult called in the app side with the error below, fails to login.

Note that, if Foursquare app is uninstalled, webview comes and I was able to login by the app. Also, I was able to login with Foursquare app installed on Android 8.0 Xperia X Performance.

Android 10 Pixel 4 XL Android 8.0 Xperia X Performance
with Foursquare app Failed OK
without Foursquare app OK OK

So probably the issue exists on the Foursquare app side with newer version of Android OS, I bit suspect this is related to a clear text traffic feature introduced since Android 9.
https://developer.android.com/training/articles/security-config.html#CleartextTrafficPermitted

Possibly this PR aims to fix the same issue of mine, but preferably the issue should be fixed by the Foursquare app side so that user can skip login hassle, in my opinion.

Stacktrace sample:

com.foursquare.android.nativeoauth.FoursquareInternalErrorException: net::ERR_CLEARTEXT_NOT_PERMITTED
	at com.foursquare.android.nativeoauth.FoursquareOAuth.getAuthCodeFromResult(FoursquareOAuth.java:127)
	at <my app package name>.onActivityResult(SettingsActivity.java:426)
	at android.app.Activity.dispatchActivityResult(Activity.java:8162)
	at android.app.ActivityThread.deliverResults(ActivityThread.java:4838)
	at android.app.ActivityThread.handleSendResult(ActivityThread.java:4886)
	at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:51)
	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)
	at android.os.Handler.dispatchMessage(Handler.java:107)
	at android.os.Looper.loop(Looper.java:214)
	at android.app.ActivityThread.main(ActivityThread.java:7356)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant