Azure AD B2C using MSAL with 2 Custom policies (ANDROID)
We are building an app that has multiple authentication flows:
- General flow - User enters email, if that email exists it asks for password and user can log in.
- Magic Link - If the user is identified as an EXECUTIVE user after entering his/her email, he/she will receive a link to the email id that was entered and when the user clicks on the link, the user will redirect to the application and will be authenticated.
The flow starts with initiating the General Sign in, once the email is identified as executive then we need to clear the session and initial the Magic link policy.
We have the general flow working fine, but if the email is identified as an EXECUTIVE we are not able to clear the previous session so we can't trigger the magic link flow.
in iOS we have this method for canceling the session
class func cancelCurrentWebAuthSession() -> Bool
But for Android I haven't found an alternative that can be used to clear the previous session if user is identified as an EXECUTIVE user.
Can someone please advise how to handle this?