Auth0 Home Blog Docs

Microsoft Azure AD won't forget last user (auth0-lock)

I have auth0-lock set up to log in through a MS Azure AD portal.

I want it to forget the last logged in user, so that I can switch between users as required for testing and such.

The problem is, despite using { rememberLastLogin: false }, the MS Azure AD portal still auto-logins in through the previously used user automatically — the popup flashes up and disappears again before I’m able to intervene. Help!

const auth = new (Auth0Lock as Auth0LockStatic)(api.auth0ClientId, process.env.AUTH0_DOMAIN as string, {
    auth: {
      redirect: false,
      responseType: 'token id_token',
      params: {
        // AUTH0_ADGROUPS_PROPERTY in JWT required by the server for auth-enabled bots
        scope: `openid ${process.env.AUTH0_ADGROUPS_PROPERTY}`
      },
      sso: false
    },
    rememberLastLogin: false,
    autoclose: true,
    language: api.locale
  });