Related to Custom Authentication? Please provide the following info too: (Optional)
Verifier Name: auth0-based-jwt-service-1
JWKS Endpoint: N/A
Sample idToken(JWT): N/A
Please provide the Web3Auth initialization and login code snippet below:
Description of Problem:
We are attempting to integrate web3Auth with no modal using sms passwordless custom authenticiation powered by Auth0 on react native. As it stands, our sense is that there is no well-documented pathway to satisfy this particular combination using the existing Web3AuthSDKS.
We’ve followed the React Native documentation and found that it does not seem to have any information about how to do no modal on react native.
The only documentation we’ve found for no modal is on the Web3Auth plug and play no modal docs. However in practice, we’ve had trouble getting this core SDK to work as it seems that it assumes a web environment when it runs.
So our current analysis is that there is no well documented pathway to doing a no modal, custom auth integration with web3Auth on react-native. We see two possible ways forward.
Either can we fork the Web3Auth core package and try to adapt it to work on react-native, or we can use the tkey SDKs directly.
Are we correct in our thinking? Or are we missing an easier integration pathway?
Because as far as I know, our React Native SDK doesn’t have modal. If you mean, no redirect screens/user flow screens, then you should consider tKey SDK.
Hey @shahbaz thanks for your reply. By “no-modal” I mean that we should own the entire UI. I want to have our own UI to query the users phone number, send and process an OTP, then take the JWT that we get from that and feed it into web3auth/tkey in order to authenticate the user.
Should we look to use tKey for this purpose? In our testing I was seeing the SDK open up a web view for auth, which takes the user out of our UI and hence is something we’d want to avoid.
Yes, with plug and play, you get a redirect from app.openlogin.com, where the actual key reconstruction happens. This makes the whole system non custodial and also easy to access. You cannot skip that in the plug and play implementation. If you don’t want any redirect, you can choose the tKey SDK.
I am working on using the tkey library now and am running into an error in the init code that once again seems to arise from it assuming a web context.
When calling init on the serviceProvider, we get the following error: “Error: UserAgent parameter can’t be empty”
Upon inspection, this seems to arise from the are3PCSupported function.
Callstack: Calling tKey.serviceProvider.init in turn calls init on a CustomAuth object, which in turn calls init on a StorageHelper object, which in turn calls the above are3PCSupported function.
The error arises because the above function assumes the existence of the navigator.userAgent property, which is absent on react-native.
Is there are a certain config or something we should be using to use tkey on react-native? Looking at this error makes me think that tkey is not compatible with react-native. Curious if you could please point me in the right direction.
Adding one more question to the thread here. As of now I’ve worked around the above issue by patching the tkey library. I’m still curious if there’s a better solution since this is a bit hacky.
Now I’m getting the following error: “Error occurred while verifying params verifier auth0-based-jwt-service-1 not found for account id: 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY”