authgear / authgear-sdk-flutter

Authgear authentication SDK for Flutter
https://www.authgear.com/
Other
2 stars 12 forks source link

[Flutter Android] The webview still login after call Logout() #64

Closed jamestsang closed 1 month ago

jamestsang commented 1 month ago

I got a problem, the webview keep login status after call logout function

Steps: 1, Call authenticate() then open the webview 2, Login Azure AD B2C with username password 3, Call logout() 4, Call authenticate() again, it will login previous account automatically.

Flutter (Channel stable, 3.16.4) flutter_authgear 1.6.0

linear[bot] commented 1 month ago

DEV-1617 [Flutter Android] The webview still login after call Logout()

fungc-io commented 1 month ago

~Hi @jamestsang , in step 4, do you still see the AuthUI for you to select the "Login with Azure AD B2C" button? Or do you see a "Continue with this account" screen?~ See reply below

fungc-io commented 1 month ago

Hi @jamestsang , In step 4, I understand that Azure AD B2C automatically logs in to the same account without requiring a username and password.

It is because customTabs on the Android device stored the session of AD B2C after login and it remains after logout in Authgear.

By setting prompt: "login" in the authenticate method during login, Authgear will forward this prompt to the Azure AD B2C connection. Which should force it to ask for a username and password again. You can refer to: https://authgear.github.io/authgear-sdk-flutter/authgear/Authgear/authenticate.html

jamestsang commented 1 month ago

Hi,

Thank you for your prompt reply. It solved my problem.

fungc-io commented 1 month ago

@jamestsang Awesome! We're thrilled to have resolved your issue. Thank you for choosing Authgear.