Auth0 Home Blog Docs

Auth0 automatically logs in user on second time

android

#1

For first time Auth0 launches login screen just fine, but when i log out, and login again, it automatically logs in without showing the login screen.

If i remove chrome history then it seems to be working fine.

My code to initialize Auth0.

auth0 = new Auth0(GlobalApplication.getAppContext());
        auth0.setLoggingEnabled(true);
        auth0.setOIDCConformant(true);
        credentialsManager = new SecureCredentialsManager(GlobalApplication.getAppContext(),
                new AuthenticationAPIClient(auth0), new SharedPreferencesStorage(GlobalApplication.getAppContext()));

This is my code to login.

public void doLogin(Activity activity){

    WebAuthProvider.init(auth0)
            .withScheme("com.package.app")
            .withAudience(String.format("https://%s/api/",
                    AUTH0_DOMAIN))
            .withScope("openid profile email offline_access read:current_user update:current_user_metadata")
            .start(activity, webCallback);

}



private final AuthCallback webCallback = new AuthCallback() {
    @Override
    public void onSuccess(@NonNull Credentials credentials) {
        credentialsManager.saveCredentials(credentials);
        accessToken= credentials.getAccessToken();
    }

When i press logout button i execute following code.

credentialsManager.clearCredentials();

This logs out the user, but it does not clear the session from chrome.
I have also added logout callback in Auth0 dashboard.

Is there any way i can clear the session from browser.

I am usingauth0-1.41.1

implementation ‘com.auth0.android:auth0:1.14.1’
implementation ‘com.auth0.android:jwtdecode:1.2.0’


#3

Hey there @Naofilms, can you snag us a HAR file when replicating this stated above work flow and DM it over to me? This will allow us to take a closer look at what may be going on. Thank you in advance!



#4

I wanted to touchbase with you @Naofilms and see if you have any additional questions on this subject. I’m happy to take a look but the next step would be getting us a HAR file capture of the posed workflow. Thanks!