I’m trying to incorporate a custom multi-factor authentication provider into the rules pipeline. If the user I am trying to authenticate requires an MFA code validation, I attempt to redirect them to a URL in the following format:
https://a.b.website.com/#/mfa/verify?token=URL_SAFE_TOKEN&state=AUTH0_STATE
I’m trying to accomplish this by ending my rule with the following snippet:
context.redirect = {
url: "https:/a.b.website.com/#/mfa/verify?token=" + token
};
return callback(null, user, context);
However, this ends up redirecting me to https://a.b.website.com/?state=AUTH0_STATE#/mfa/verify?token=URL_SAFE_TOKEN.
I removed the # from the redirect URL by ending my rule with the following snippet:
context.redirect = {
url: "https:/a.b.website.com/mfa/verify?token=" + token
};
return callback(null, user, context);
This ends up redirecting me to a sane URL, https://a.b.website.com/mfa/verify?token=URL_SAFE_TOKEN&state=AUTH0_STATE, but this isn’t viable for me.
Am I missing another way to include a # in the redirect URL or is it not possible at this time?