Hello Auth0 Support Team,
I am encountering an issue with passing custom parameters to the MFA challenge screen through the authorize
function in my React Native application. My goal is to display custom texts on the MFA challenge screen depending on the reason for the identity confirmation (e.g., paying for something, updating, or deleting an MFA factor).
Issue Details:
On the Web (using auth0-react):
I am able to pass custom parameters through the fragment
property in the loginWithRedirect
function as shown below:
return loginWithRedirect({
fragment: "extra=params&rent:mfa=true&rent:confirmCredentials=true",
authorizationParams: {
prompt: undefined,
scope: TRANSFER_FUNDS_SCOPE,
},
appState: {
...appState,
returnTo,
},
});
These parameters are available in the URL and can be accessed on the MFA challenge page.
On React Native (using react-native-auth0):
However, in React Native, there is no equivalent fragment
property. I tried using the additionalParameters
property, but these parameters are only accessible during login or sign-up, and not on the MFA challenge screen. Here is the code snippet I am using:
await authorize(
{
audience: ENV.AUTH0_AUDIENCE,
scope: `${DEFAULT_SCOPE} ${UPDATE_MFA_SCOPE}`,
additionalParameters: {
mfa: 'true',
confirmCredentials: 'true',
},
},
{ useSFSafariViewController: { presentationStyle: 7 } },
);
Problem:
I need to pass custom parameters to the MFA challenge screen in React Native similar to how it is done on the web, but I am unable to do so with the current react-native-auth0
library. Specifically, I need to show custom texts based on the context (e.g., to pay for something or to update/delete an MFA factor).
Request:
Could you please provide guidance on how to achieve this functionality in React Native? Is there a way to pass custom parameters that can be accessed on the MFA challenge screen?