aad_oauth icon indicating copy to clipboard operation
aad_oauth copied to clipboard

Logout does not clear key from local storage/cache (android)

Open nicklohuis opened this issue 2 years ago • 7 comments

the logout call doesn't clear the key, my app uses the availability of the key for authorization, so when i call logout and go back to the login page, it just authorizes immediately

nicklohuis avatar Jun 29 '23 07:06 nicklohuis

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If you still think this issue is needed, reopen it again.

stale[bot] avatar Sep 17 '23 06:09 stale[bot]

Same issue I have observed on Android and iOS as well. Also, trying to log out multiple times clears the key from local storage (generally after 2-3 tries)

nayanAubie avatar Dec 28 '23 05:12 nayanAubie

Same issue I have observed on Android and iOS as well. Also, trying to log out multiple times clears the key from local storage (generally after 2-3 tries)

@nayanAubie Hi, I also facing same issue for iOS logout which is working fine in Android.

First time after opening the app, after await mfaAuthentication.login(); calling await mfaAuthentication.getAccessToken() is not calling.

After mfaAuthentication.logout(); of application the second time below code is running.

      await mfaAuthentication.login();
      String? accessToken = await mfaAuthentication.getAccessToken();

Please suggest if you resolve the issue.

GDEVENDRAK avatar Jun 29 '24 06:06 GDEVENDRAK

@GDEVENDRAK aad_oauth is not using the native library for MSAL, instead, it is using a browser session and that is not a proper way for mobile. You can use this one if you like. (made by me) => msal_auth

nayanbabariya avatar Jul 01 '24 04:07 nayanbabariya

I have the same issue on Flutter web. I have to log out twice that the cache is cleared properly.

I call the logout function and after that I clear the browser cache. Immediately after the logout, there are entries placed in the local storage that enables the direct login. After a second logout, these entries are deleted properly.

AliGuemues avatar Jul 01 '24 09:07 AliGuemues

@GDEVENDRAK aad_oauth is not using the native library for MSAL, instead, it is using a browser session and that is not a proper way for mobile. You can use this one if you like. (made by me) => msal_auth

ok, I need to update to MSAL in future. Coming aad_oauth I noticed I am not calling mfaAuthentication.logout(); in await. After adding await it is working fine now.

I will definitely check your package for MSAL. Thank you for the support.

GDEVENDRAK avatar Jul 01 '24 09:07 GDEVENDRAK

I have the same issue on Flutter web. I have to log out twice that the cache is cleared properly.

I call the logout function and after that I clear the browser cache. Immediately after the logout, there are entries placed in the local storage that enables the direct login. After a second logout, these entries are deleted properly.

Hi, I noticed I am not calling mfaAuthentication.logout(); in await. After adding await it is working fine now.

GDEVENDRAK avatar Jul 01 '24 09:07 GDEVENDRAK

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If you still think this issue is needed, reopen it again.

github-actions[bot] avatar Aug 31 '24 02:08 github-actions[bot]

Closing this issue due to lack of activity.

github-actions[bot] avatar Oct 01 '24 02:10 github-actions[bot]