MaikuB/flutter_appauth

Crash during redirect after logout is successfull

rajath-1990 opened this issue · 3 comments

I am using this library for authorization app Azure AD. Login is working fine. App is crashing after logout. Crash is happening when it redirects back to the app.

_postLogoutRedirectUrl will be a normal website URL that has been verified by uploading asset_link.json in the server (This is required for app linking)

Please help me in fixing this.

Here is the code:

await _appAuth.endSession(EndSessionRequest(
      idTokenHint: _idToken,
      postLogoutRedirectUrl: _postLogoutRedirectUrl,
      serviceConfiguration: _serviceConfiguration));

Crash: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
E/AndroidRuntime( 4223): Caused by: java.lang.NullPointerException: dataIntent must not be null
E/AndroidRuntime( 4223): at net.openid.appauth.Preconditions.checkNotNull(Preconditions.java:55)
E/AndroidRuntime( 4223): at net.openid.appauth.EndSessionResponse.fromIntent(EndSessionResponse.java

android manifest:

        <intent-filter>
            <action android:name="android.intent.action.MAIN"/>
            <category android:name="android.intent.category.LAUNCHER"/>
        </intent-filter>

        <intent-filter android:autoVerify="true">
            <action android:name="android.intent.action.VIEW"/>
            <category android:name="android.intent.category.DEFAULT"/>
            <category android:name="android.intent.category.BROWSABLE"/>
            <data android:scheme="https" android:host="somewebsite.com"/>
        </intent-filter>
    </activity>
    <!-- Don't delete the meta-data below.
            This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
    <meta-data android:name="flutterEmbedding" android:value="2"/>
</application>