okta-react-native
okta-react-native copied to clipboard
[Help Needed] Adding the deviceToken in the latest SDK
I have recently upgraded the OKTA SDK to version 2.2.0. Earlier there is option to send the deviceToken with signIn that helped not to trigger the MFA_REQUIRED on the same device. But now I am not seeing that option instead I can see the sendFingerPrint boolean.
Can you please advise on this
Hello @konampruthvirajkumar
Thanks for raising the issue.
The latest version has upgraded dependencies, including okta-auth-js
. There's a migration guide from version 4.x to 5.x.
Could you, please, provide a sample code that you used before?
@oleggnidets-okta , that was so quick. thank you for responding.
here is the code from version 1.x.x
try {
const options = {
multiOptionalFactorEnroll: true,
warnBeforePasswordExpired: false,
};
const context = { deviceToken };
return await authClient.signIn({ username, password, options, context });
} catch (error) {
throw error;
}
}````
{
"username": "[email protected]",
"password": "correcthorsebatterystaple",
"options": {
"multiOptionalFactorEnroll": true,
"warnBeforePasswordExpired": false
},
"context": {
"deviceToken": "26q43Ak9Eh04p7H6Nnx0m69JqYOrfVBY"
}
I discussed the issue with my colleague and we think the code looks good. signIn
method can still pass deviceToken
without any code change.
We think it may be type issue. Do you use TypeScript?
thanks for the confirmation. yes I am using Typescript.
So the issue comes from SigninOptions.context. For now being, it's typed as string but should be an object, internal ticket OKTA-462292.
As a current solution try to pass an argument as a string.