AppAuth-Android
AppAuth-Android copied to clipboard
Can't use the library on Android 4.4.2 (kitkat) : Authorization Canceled
Steps to reproduce the issue
- Start a new authorization request :
LoginActivityis launched - Fill in login/password and register
- CustomTab is closed.
LoginActivityreceives aresultCode == RESULT_CANCELED(onActivityResult()method)
My investigation :
startActivityForResult(intent, RC_AUTH) is called but onActivityResult(int requestCode, int resultCode, Intent data) immediately returns with resultCode == RESULT_CANCELED .
Also, AuthorizationManagementActivity is then called, but the request failed since LoginActivity has been canceled.
The library seems not to be compatible with Android Version 4.4.2 (and probably below, but can't test right now) .
Phone model : GT-I9195 Android version : 4.4.2
@MalikDE It happens because net.openid.appauth.AuthorizationManagementActivity has launchMode="singleTask" Just add following lines to your AndroidManifest.xml
<activity
android:name="net.openid.appauth.AuthorizationManagementActivity"
android:exported="false"
android:launchMode="singleTop"
android:theme="@android:style/Theme.Translucent.NoTitleBar"
tools:replace="android:launchMode" />
Tested on API level 19, after user clicked on the Google account, the browser redirects to https://www.google.com and the browser stays on top. The native android app is not back to foreground.
the same problem, still not fixed
@MalikDE Have you come across a solution for this?
I have tried several things and am unable to get this working on api 19 devices. @michael-oknov 's solution did not work as you're never redirected back to the app after authenticating.
@Barryrowe Agree : solution provided did not work for me. I was forced to set min api of my app to 21 ...
@MalikDE thanks for the update. I'm leaning toward this myself, especially as API < 21 is less and less market share, but it worries me as we try to gain more market outside of North America where the API versions vary a lot more.
I think this is a duplicate of #299 (and a couple of other tickets that have already been abandoned and closed). As described there, use the performAuthorizationRequest flow.