Trying to configure core-kit react native sdk

Please provide the following details too when asking for help in this category:

  • SDK Version:core-kit-react-native sdk
  • Verifier Details: custom jwt verifier
    • Verifier Name: staging-axr-wallet
    • JWKS Endpoint: https://api-staging.axirwallet.com/.well-known/jwks.json
    • Sample idToken(JWT)
      idToken: eyJ0eXAiOiJqd3QiLCJhbGciOiJSUzI1NiIsImtpZCI6IlNGU0NEU2ROYkRUMnEzNGJDalJHdDQ0ZGhNZkxWUkllbEVYNHQ2bzI3Y0UifQ.eyJzdWIiOiIxNjEiLCJuYW1lIjoieWFzaG9kZWVwMDA5KzE0QGdtYWlsLmNvbSIsImVtYWlsIjoieWFzaG9kZWVwMDA5KzE0QGdtYWlsLmNvbSIsInBob25lTnVtYmVyIjoiKzkxOTU5NTU1OTQzMSIsImV4cCI6MTY4NDQxNjQwNiwiaWF0IjoxNjg0MzMwMDA2LCJpc3MiOiJodHRwczovL2FwaS1zdGFnaW5nLmF4aXIuaW8iLCJhdWQiOiJheHItd2FsbGV0In0.iMB19tHtNGZPJQ8-35gerTlDHtRySnr42uOwUUOOegOYaJWQYWMRpRKuSexXvuaBPRQHslChTHQIMOm492cMjLOEy2cnjmfjsmZdOr5WBjGydpayQVmGTHPYPARxgkorAcijftzjKW1fnGYBNsnpTSEKqc-hsAAcKCt6txpZk0C4NUGf6J1a3y6zuhvecrM0fbGhB1CdwRsNka5HGvYUNeRwAx1eEOjnpxNRHtTsq-QcOEZ0ipUlRz3RBQ8K2-Eoxrda4TPmxCoerpxvyUMCrLkhSoRrhtlJrQuBr5VTREizeTWGulz2tnubGxmcQtgZHXSphRcDiH-orbZmq144ug

Hi Team,
As discussed in last meet, you said that you will be working on core-they sdk for react native. Our question is that:
Right now is it possible to use core sdk with custom auth backend in react native? As We saw there is resolverURI which is giving the error. But please let us know if there is any solution for this right now if not, till when can we expect the react native sdk to support custom auth server?

Following error we are getting with core sdk on react-native for custom auth backend:

image

This error occurred while logging into the core-kit react native sdk with our auth backend.

Hi Team,
Please update on the error mentioned.

Hey @productionsillegal

It seems that there is an inconsistency between the aud field in the JWT token and the verifier that was created. Specifically, for the staging-axr-wallet verifier, the iss should be https://api-staging.axirwallet.com but in the JWT it is currently https://api-staging.axir.io. It’s important to double-check the idToken generation process to ensure accuracy.

Hi Shabaz, Thanks for your response. I checked the idToken now it’s consistent. But It is still showing the same error. Let me share the screenshot and idToken with you. Also please confirm if we can use RN core kit sdk with our custom backend server. If not then what is the solution.

idToken: eyJ0eXAiOiJqd3QiLCJhbGciOiJSUzI1NiIsImtpZCI6IlNGU0NEU2ROYkRUMnEzNGJDalJHdDQ0ZGhNZkxWUkllbEVYNHQ2bzI3Y0UifQ.eyJzdWIiOiIxNjEiLCJuYW1lIjoieWFzaG9kZWVwMDA5KzE0QGdtYWlsLmNvbSIsImVtYWlsIjoieWFzaG9kZWVwMDA5KzE0QGdtYWlsLmNvbSIsInBob25lTnVtYmVyIjoiKzkxOTU5NTU1OTQzMSIsImV4cCI6MTY4NDU4OTAyOSwiaWF0IjoxNjg0NTAyNjI5LCJpc3MiOiJodHRwczovL2FwaS1zdGFnaW5nLmF4aXJ3YWxsZXQuY29tIiwiYXVkIjoiYXhyLXdhbGxldCJ9.UxDANCQUpdG8ZIhDkiD56fhQuT0OwyB5fimjReqYXUUtCv4IVOCK4olpwgjwIdHtRd7xmAEb8s3JNhARrvzizSu4EJppRrO0oMuRhIuLFq4DZppG1Fd0l5qND2iN7ta-HQkqBze9kML3lUVWPslcxKbMer42x-7N6OaRlaSJqwgwFdOQyrKG9uq66XvNQXttra8DOeE6rzQoZUp2iOcKKHw65vanLG91VA1pBRxLUYytbax_oQLZfZLhINH1ocLLIVn4mwuoXUm-tGSNtfz3o0ldEhF0-f2r-slxeGRzqoZTZuiDPRHl2Ot2TufiL72ShxJfT6VgqpBo3ieqzmbdsA

error:

Hey @productionsillegal

Please share the error logs. Use How to debug Android devices?

Hi @shahbaz, Please find the error logs below:
[
{
“code”: “400”,
“message”: "getTorusKey: ",
“domain”: “Swift.String”,
“userInfo”: {},
“nativeStackIOS”: [
“0 tkeyrnexample 0x000000010060c698 RCTJSErrorFromCodeMessageAndNSError + 112”,
“1 tkeyrnexample 0x00000001005a9e90 41-[RCTModuleMethod processMethodSignature]block_invoke_2.73 + 152",
“2 tkeyrnexample 0x00000001004fa1d8 $sSo8NSStringCSgACSo7NSErrorCSgIeyByyy_SSSgAGs5Error_pSgIegggg_TR + 380”,
"3 tkeyrnexample 0x00000001004fda74 $s15RNCustomAuthSdkAAC11getTorusKey_10verifierId0G6Params7idToken8resolver8rejecterySS_SSSDySSypGSgSSyypSgcySSSg_ALs5Error_pSgtctFyyYaYbcfU_TY3
+ 504",
"4 tkeyrnexample 0x00000001004fdc95 $s15RNCustomAuthSdkAAC11getTorusKey_10verifierId0G6Params7idToken8resolver8rejecterySS_SSSDySSypGSgSSyypSgcySSSg_ALs5Error_pSgtctFyyYaYbcfU_TATQ0
+ 1",
"5 tkeyrnexample 0x0000000100500c2d $sxIeghHr_xs5Error_pIegHrzo_s8SendableRzs5NeverORs_r0_lTRTQ0
+ 1”,
“6 tkeyrnexample 0x0000000100500fe5 $sxIeghHr_xs5Error_pIegHrzo_s8SendableRzs5NeverORs_r0_lTRTATQ0_ + 1”,
“7 libswift_Concurrency.dylib 0x00000001b1660445 _ZL23completeTaskWithClosurePN5swift12AsyncContextEPNS_10SwiftErrorE + 1”
]
}
]

[
{
“code”: “400”,
“message”: "getTorusKey: ",
“domain”: “Swift.String”,
“userInfo”: {},
“nativeStackIOS”: [
“0 tkeyrnexample 0x000000010060c698 RCTJSErrorFromCodeMessageAndNSError + 112”,
“1 tkeyrnexample 0x00000001005a9e90 41-[RCTModuleMethod processMethodSignature]block_invoke_2.73 + 152",
“2 tkeyrnexample 0x00000001004fa1d8 $sSo8NSStringCSgACSo7NSErrorCSgIeyByyy_SSSgAGs5Error_pSgIegggg_TR + 380”,
"3 tkeyrnexample 0x00000001004fda74 $s15RNCustomAuthSdkAAC11getTorusKey_10verifierId0G6Params7idToken8resolver8rejecterySS_SSSDySSypGSgSSyypSgcySSSg_ALs5Error_pSgtctFyyYaYbcfU_TY3
+ 504",
"4 tkeyrnexample 0x00000001004fdc95 $s15RNCustomAuthSdkAAC11getTorusKey_10verifierId0G6Params7idToken8resolver8rejecterySS_SSSDySSypGSgSSyypSgcySSSg_ALs5Error_pSgtctFyyYaYbcfU_TATQ0
+ 1",
"5 tkeyrnexample 0x0000000100500c2d $sxIeghHr_xs5Error_pIegHrzo_s8SendableRzs5NeverORs_r0_lTRTQ0
+ 1”,
“6 tkeyrnexample 0x0000000100500fe5 $sxIeghHr_xs5Error_pIegHrzo_s8SendableRzs5NeverORs_r0_lTRTATQ0_ + 1”,
“7 libswift_Concurrency.dylib 0x00000001b1660445 _ZL23completeTaskWithClosurePN5swift12AsyncContextEPNS_10SwiftErrorE + 1”
]
}
]

[
{
“code”: “400”,
“message”: "getTorusKey: ",
“domain”: “Swift.String”,
“userInfo”: {},
“nativeStackIOS”: [
“0 tkeyrnexample 0x000000010060c698 RCTJSErrorFromCodeMessageAndNSError + 112”,
“1 tkeyrnexample 0x00000001005a9e90 41-[RCTModuleMethod processMethodSignature]block_invoke_2.73 + 152",
“2 tkeyrnexample 0x00000001004fa1d8 $sSo8NSStringCSgACSo7NSErrorCSgIeyByyy_SSSgAGs5Error_pSgIegggg_TR + 380”,
"3 tkeyrnexample 0x00000001004fda74 $s15RNCustomAuthSdkAAC11getTorusKey_10verifierId0G6Params7idToken8resolver8rejecterySS_SSSDySSypGSgSSyypSgcySSSg_ALs5Error_pSgtctFyyYaYbcfU_TY3
+ 504",
"4 tkeyrnexample 0x00000001004fdc95 $s15RNCustomAuthSdkAAC11getTorusKey_10verifierId0G6Params7idToken8resolver8rejecterySS_SSSDySSypGSgSSyypSgcySSSg_ALs5Error_pSgtctFyyYaYbcfU_TATQ0
+ 1",
"5 tkeyrnexample 0x0000000100500c2d $sxIeghHr_xs5Error_pIegHrzo_s8SendableRzs5NeverORs_r0_lTRTQ0
+ 1”,
“6 tkeyrnexample 0x0000000100500fe5 $sxIeghHr_xs5Error_pIegHrzo_s8SendableRzs5NeverORs_r0_lTRTATQ0_ + 1”,
“7 libswift_Concurrency.dylib 0x00000001b1660445 _ZL23completeTaskWithClosurePN5swift12AsyncContextEPNS_10SwiftErrorE + 1”
]
}
]

==========end of error log===========

idToken Used is as following:
eyJ0eXAiOiJqd3QiLCJhbGciOiJSUzI1NiIsImtpZCI6IlNGU0NEU2ROYkRUMnEzNGJDalJHdDQ0ZGhNZkxWUkllbEVYNHQ2bzI3Y0UifQ.eyJzdWIiOiIyMDIiLCJuYW1lIjoicHJvZGVlcDAwOSsyM0BnbWFpbC5jb20iLCJlbWFpbCI6InByb2RlZXAwMDkrMjNAZ21haWwuY29tIiwicGhvbmVOdW1iZXIiOiIrOTE5NTk1NTU5NDMxIiwiZXhwIjoxNjg0ODMyMDIzLCJpYXQiOjE2ODQ3NDU2MjMsImlzcyI6Imh0dHBzOi8vYXBpLXN0YWdpbmcuYXhpcndhbGxldC5jb20iLCJhdWQiOiJheHItd2FsbGV0In0.yn2KRWIlldRWhgb2QRqlke_AnWpwhGXd_ZN4vSyQcaWCcThK0PYBKHxPLVdf6CNkZ1Ff0_bKLu-F64YzVbePNgFj_6jrPRAna6jqcTLy9bAiPhgF_bEq1WRXacq-YYug6_naGpztBH_dk0Q2fB79BvX6lKlKLr-VaLuggEybsjdMBUHV6E_Dav7nr2ObHpYElMZBOrihK-SpCVG699m0x92RR-8eENDJm6nm6QLnj6j_IZJuMfLESsq69AbCFbMie6c6HGWwaOo1EAnbw_0ZHfgRPwcUaXOOc2D82-lp95ojq-s6H2FcosN98VrmJmuxgsOikXgCdX-stJetz2xaTg

I am passing the idToken just like firebase example by web3auth:

Hi @shahbaz, Please let us know if Any update on this.

Hi Team,
Please respond on this. Thanks!

@shahbaz Any update yet? please let us know.

What’s the verifierId here?

      const loginDetails = await CustomAuth.getTorusKey(
        verifier,
        verifierId, // <<---- what value are you passing here?
        {
          verifierIdField: 'sub',
          verifier_id: verifierId,
        },
        idToken,
      );

We are passing sub from the idToken:

Verifier staging-axr has https://api-staging.axir.io as the iss value. And your JWT token has "iss": "https://api-staging.axirwallet.com", or use staging-axr-wallet as verifer name that you shared above.
Screenshot 2023-05-30 at 11.45.54 AM

Hi Shabaz, I used “staging-axr-wallet” and the error log is as below:

[
{
“code”: “400”,
“message”: "getTorusKey: ",
“domain”: “Swift.String”,
“userInfo”: {},
“nativeStackIOS”: [
“0 tkeyrnexample 0x0000000102a50698 RCTJSErrorFromCodeMessageAndNSError + 112”,
“1 tkeyrnexample 0x00000001029ede90 41-[RCTModuleMethod processMethodSignature]block_invoke_2.73 + 152",
“2 tkeyrnexample 0x000000010293e1d8 $sSo8NSStringCSgACSo7NSErrorCSgIeyByyy_SSSgAGs5Error_pSgIegggg_TR + 380”,
"3 tkeyrnexample 0x0000000102941a74 $s15RNCustomAuthSdkAAC11getTorusKey_10verifierId0G6Params7idToken8resolver8rejecterySS_SSSDySSypGSgSSyypSgcySSSg_ALs5Error_pSgtctFyyYaYbcfU_TY3
+ 504",
"4 tkeyrnexample 0x0000000102941c95 $s15RNCustomAuthSdkAAC11getTorusKey_10verifierId0G6Params7idToken8resolver8rejecterySS_SSSDySSypGSgSSyypSgcySSSg_ALs5Error_pSgtctFyyYaYbcfU_TATQ0
+ 1",
"5 tkeyrnexample 0x0000000102944c2d $sxIeghHr_xs5Error_pIegHrzo_s8SendableRzs5NeverORs_r0_lTRTQ0
+ 1”,
“6 tkeyrnexample 0x0000000102944fe5 $sxIeghHr_xs5Error_pIegHrzo_s8SendableRzs5NeverORs_r0_lTRTATQ0_ + 1”,
“7 libswift_Concurrency.dylib 0x00000001b1660445 _ZL23completeTaskWithClosurePN5swift12AsyncContextEPNS_10SwiftErrorE + 1”
]
}
]