MaikuB / flutter_appauth

A Flutter wrapper for AppAuth iOS and Android SDKs
274 stars 246 forks source link

Browser does not redirect back to app after logout (postLogoutRedirectUrl does not work) #564

Open maysgar opened 2 weeks ago

maysgar commented 2 weeks ago

When doing:

await _appAuth.endSession(EndSessionRequest(
          idTokenHint: idToken,
          postLogoutRedirectUrl: postLogoutRedirectUrl,
          serviceConfiguration: serviceConfiguration,
          externalUserAgent: externalUserAgent
          ));

The app triggers the browser and successfully logs out the user. However, after that, it does not automatically redirect the user back to the app, as it does with login.

I can see that in the example project the logout redirects the user to a website where there is a manual button to return to the app. In my case, I want to redirect the user directly to the app without having a button on the logout browser page.

Because of this, the only option is to have the user manually exit the browser to return to the app, which triggers AppAuth Error: The user cancelled the flow! and does not get information back on whether the logout was successful or not.

MaikuB commented 2 weeks ago

The example app is behaving that way only because of the how the demo IdentityServer instance is configured. Have personally used this with Azure B2C where it redirects back to the app without needing the user to interact with a website. If you're not seeing a redirect happening then you will need to check if you have a configuration issue or that the server you're using follows the specification for the method to work