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

authorizeAndExchangeCode not returning on Android 14 #458

Open
guy-utila opened this issue Oct 12, 2023 · 5 comments
Open

authorizeAndExchangeCode not returning on Android 14 #458

guy-utila opened this issue Oct 12, 2023 · 5 comments

Comments

@guy-utila
Copy link

We have an app that is working well with flutter_appauth for a while (iOS and Android). Recently I upgraded my Android device to Android 14 and now it seems like I can not login (using Google), I get to see the Google account selection but after selecting the account the screen redirects to itself and hangs on the loading state.

All I get in the debug are these messages:

W/AppAuth ( 586): No stored state - unable to handle response
W/iour.app.name( 586): Cleared Reference was only reachable from finalizer (only reported once)

To be clear - same code base has no issues when running in either iOS or Android 11.

Is there a know issue with Android 14?

@debasmitasarkar
Copy link

is there any update regarding this? This is a major issue.

@MaikuB
Copy link
Owner

MaikuB commented Oct 19, 2023

If you believe it's Android 14 related then you should be able to clone the repository and run the example app to confirm. I'm not in a position to check right now but have been running other apps using this library on Android 14 without issues. I suspect your issue is more to do with a change that Google brought about to authentication using their services https://developers.googleblog.com/2023/10/enhancing-oauth-app-impersonation-protections.html?m=1

@guy-utila
Copy link
Author

It seems like our issue is related to this one: openid/AppAuth-Android#977
It is a bug in Android 14 and should be fixed. Methods of resolving the issue are proposed in the link.

@praharshbhatt
Copy link

The interim solution mentioned in openid/AppAuth-Android#977 (comment) works for now:

        <activity
            android:name="net.openid.appauth.AuthorizationManagementActivity"
            android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation|keyboard|keyboardHidden"
            android:exported="false"
            android:launchMode="singleInstance"
            android:theme="@style/Theme.AppCompat.Translucent.NoTitleBar"
            tools:node="replace"/>
        <activity
            android:name="net.openid.appauth.RedirectUriReceiverActivity"
            android:exported="true"
            tools:node="replace">
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />

                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />

                <data android:scheme="${appAuthRedirectScheme}" />
            </intent-filter>
        </activity>

@gabrielmulyawan
Copy link

@praharshbhatt its work, but if u back to app first and back to auth, will be get loop. and the app gone.

any update, without change the launch mode to singleInstance ?

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

5 participants