How to ask Microsoft credentials on subsequent logins?
Hi all, is there a way to "clear the cache" so that on subsequent logins it asks me for my microsoft credentials in the webview? I tried "clearSession", but the next time I log in it doesn't ask me for credentials
Hi Marco,
please check out the sample app. If I logout there and then click login again - I'm always asked for credentials! (tested on Android emulator)
Hi, i see in the example "azureAuth.webAuth.clearSession()" but at the next login not ask me credentials (test on ios emulator and android device)
Have you tested with sample app or with you own only?
It happens to me too, and I think that it is related to the other issue I opened. It doesn't ask for the credentials again because the clearSession doesn't actually resolve the logout. At least not on real devices.
facing same issue, tested on real and emulator both android and ios.
@0xc14m1z @akshgods Hi Guys, I can not see your code, so please check the behaviour based on test with the sample app! Check it out, replace the client ID in the App.js and do the same test. Otherwise I don't get what am I doing wrong :))) , so that in my tests all works as intended.
@vmurin I confirm, not even works for me requires credentials with the sample app.
this is my code, very simple:
import {isAndroid} from "../utils/dimension";
const azureAuth = new AzureAuth({
clientId: '9ebaf856-026d-49bd-b26c-a026667b71e7',
redirectUri: isAndroid ? 'msauth://com.gsm.buildings/Bfqg%2BiOTWf02SCYBvmmKK1qrtxM%3D' : 'msauth.com.gsm.buildings://auth',
persistentCache: false,
});
export const getAzureToken = async () => {
return await azureAuth.webAuth.authorize({scope: 'openid profile User.Read Mail.Read' })
}
export const logoutAzure = async () => {
return await azureAuth.webAuth.clearSession({closeOnLoad: true})
}
I tried both with and without "persistCache" and "closeOnLoad"
@vmurin I literally just cloned the sample app, changed the clientId and the bundle identifier to have the callback url to work. It doesn't log me out 😔
I have just tested the sample app on the real device (Samsung S10). It works as intended. It asks me for credentials every time I click login button!!!
So my suggestion - there is something with the app registration... @0xc14m1z Could you please check it up. Please run the sample app without any changes with my Client ID: 9e124cf5-641c-4f4d-907f-937714c66e3d
You can add prompt: 'login' in azureAuth.webAuth.authorize method.
let tokens = await azureAuth.webAuth.authorize({ prompt: 'login', scope: 'openid profile User.Read offline_access Calendars.Read', });