auth0-blog / flutter-authentication

Get Started with Flutter Authentication
65 stars 59 forks source link

Logout vs Logout SSO #4

Open MartyBolton opened 3 years ago

MartyBolton commented 3 years ago

Hi, great flutter demo with OAuth2 - finally found a sample that actually works! Question more than anything - how is Logout supposed to work? Right now it deletes the refresh token, but when you click Login again, it re-logs me in using previous credentials. I was expecting a logout that forces the user to sign-in again or change credentials. How do you envision that to work? Was that the intention of Logout? Maybe we need PR that does both? Or maybe that's a setting in Auth0 connections? thanks - great demo!

Future<void> logoutAction() async {
    await secureStorage.delete(key: 'refresh_token');
    setState(() {
      isLoggedIn = false;
      isBusy = false;
    });
  }
nyoro commented 3 years ago

@MartyBolton Please refer to this documentation for detail. https://auth0.com/blog/get-started-with-flutter-authentication/#Add-user-logout-with--logoutAction-

Add user logout with logoutAction While a complete secure logout is beyond the scope of this article, let me mention that you can request an interactive login in the Authorization Server by passing an additional prompt=login parameter within the loginAction() method by uncommenting the promptValues line from the definition of its result variable: