Hi,
How do I trigger MFA on specific page?
Regards,
Hi,
How do I trigger MFA on specific page?
Regards,
Thanks for reaching out to Auth0 community!
Can you please explain a bit more on this, do you mean you want to trigger MFA for certain endpoint when user try to access, is that what your looking for?
Please check this documentation of Step-up MFA, Add Step-up Authentication
and if you want to trigger for certain endpoint the please go through this documentation. Configure Step-up Authentication for APIs
Regards,
Pavan.
Hi Pavan,
Thank you for your reply. I need to fire MFA on specific page
So I did the following.
1) Add this code in action script
exports.onExecutePostLogin = async (event, api) => {
const CLIENTS_WITH_MFA = [‘bdfgdfwmdV7GWCQxGk6P7WQJFkVZ’];
// run only for the specified clients
if (CLIENTS_WITH_MFA.includes(event.client.client_id)) {
// ask for MFA only if scope transfer:funds was requested
if (event.transaction.requested_scopes.indexOf(‘openid delete:users’) > -1)
//api.redirect.sendUserTo(“https://my-app.exampleco.com”);
api.multifactor.enable(‘any’, { allowRememberBrowser: false });
}
}
2)Then I fire this link to trigger MFA when user access to specific page
After that, what should I do next to redirect user to the specific page ?
I’m using C#
Thank you
Charles