Invalid Params error - Flutter Auth0

I have cloned the w3a-flutter-auth0 project and ran it.

I have updated my clientId in Web3AuthFlutter.init and loginConfig[‘jwt’] options verifier, clientId

The application loads fine however I get “invalid params” error which isn’t very descriptive so I am unsure how to fix the issue.

In Projects > Custom Authentication I have set-up different versions of the Verifier using some docs on the website - the latest one I am using is auth0-jwt in client ID BPQgCaSlVcFX03JhY7QUkR0MfX2oUy3d17DF-nvN9txrWI5Of4D6IRB5BEONX34fcQw-hadfJcvSpDV8d1PV75o

details:
cupertino_icons: ^1.0.2
web3auth_flutter: ^3.1.1
web3dart: ^2.4.1
shared_preferences: ^2.0.15

dev_dependencies:
flutter_test:
sdk: flutter

https://github.com/Web3Auth/web3auth-pnp-examples/tree/main/flutter/flutter-auth0-example/ is the base code, nothing else apart from the params have changed.

Hey @chris1

Looks like you have selected name as your JWT verifier ID. And the name is not a unique value for the user. Can you update the verifier and select Email or Sub as the JWT Verifier ID?

Thanks for replying.

I tested lots of versions of the configuration, name was shown in one of the documents you have online but I have changed this back to sub.

I have managed to get it working now by updating the domain param in Web3AuthFlutter.login:

Future _withAuth0() {
return Web3AuthFlutter.login(LoginParams(
loginProvider: Provider.jwt,
extraLoginOptions: ExtraLoginOptions(
domain: ‘https://nftworkx-dev.uk.auth0.com’,
verifierIdField: ‘sub’)));
}

This now fixes the original error, however I now have a new error.

When logging in on the social provider of Auth0 I get the following error on the web3auth callback:

Mount error: clientSecret is not defined

[{“errorMsg”:“clientSecret%20is%20not%20defined”,“errorStack”:“@Web3Auth Error”,“createdAt”:“17/11/2023, 08:30:19”,“info”:{“customAuthState”:{“client”:“BPQgCaSlVcFX03JhY7QUkR0MfX2oUy3d17DF-nvN9txrWI5Of4D6IRB5BEONX34fcQw-hadfJcvSpDV8d1PV75o”,“currentLoginProvider”:“jwt”,“popupWindow”:“false”,“whiteLabel”:“{"mode":"auto","theme":{"primary":"#eb5424"},"logoDark":"https://cdn.icon-icons.com/icons2/2389/PNG/512/flutter_logo_icon_145273.png\“,\“appUrl\”:\“https://web3auth.io\”,\“logoLight\”:\“https://www.vectorlogo.zone/logos/flutterio/flutterio-icon.svg\”,\“defaultLanguage\”:\“en\”,\“useLogoLoader\”:true}”,“keyMode”:“v1”,“isCustomVerifier”:“true”,“socialFactorFlow”:”“,“loginId”:“bca130923587249b04147de0b2bb03b56282ccee7b12d025d638b8ae1dbe482d”,“sessionNamespace”:”“,“version”:“6”,“instanceId”:“mc65s80i689”,“verifier”:“auth0-jwt”,“typeOfLogin”:“jwt”,“redirectToOpener”:false},“customAuthArgs”:{“typeOfLogin”:“jwt”,“verifier”:“auth0-jwt”,“clientId”:“CVhfABkn7gArGzgqUIn85rP8a39j2XkK”,“jwtParams”:{“domain”:“https://nftworkx-dev.uk.auth0.com”,“verifierIdField”:“sub”},“customState”:{“client”:“BPQgCaSlVcFX03JhY7QUkR0MfX2oUy3d17DF-nvN9txrWI5Of4D6IRB5BEONX34fcQw-hadfJcvSpDV8d1PV75o”,“currentLoginProvider”:“jwt”,“popupWindow”:“false”,“whiteLabel”:”{"mode":"auto","theme":{"primary":"#eb5424"},"logoDark":"https://cdn.icon-icons.com/icons2/2389/PNG/512/flutter_logo_icon_145273.png\“,\“appUrl\”:\“https://web3auth.io\”,\“logoLight\”:\“https://www.vectorlogo.zone/logos/flutterio/flutterio-icon.svg\”,\“defaultLanguage\”:\“en\”,\“useLogoLoader\”:true}”,“keyMode”:“v1”,“isCustomVerifier”:“true”,“socialFactorFlow”:“”,“loginId”:“bca130923587249b04147de0b2bb03b56282ccee7b12d025d638b8ae1dbe482d”,“sessionNamespace”:“”,“version”:“6”}},“customAuthError”:“clientSecret%20is%20not%20defined”,“customAuthHashParams”:{“error”:“access_denied”,“error_description”:“clientSecret%20is%20not%20defined”,“state”:“eyJjbGllbnQiOiJCUFFnQ2FTbFZjRlgwM0poWTdRVWtSME1mWDJvVXkzZDE3REYtbnZOOXR4cldJNU9mNEQ2SVJCNUJFT05YMzRmY1F3LWhhZGZKY3ZTcERWOGQxUFY3NW8iLCJjdXJyZW50TG9naW5Qcm92aWRlciI6Imp3dCIsInBvcHVwV2luZG93IjoiZmFsc2UiLCJ3aGl0ZUxhYmVsIjoie1wibW9kZVwiOlwiYXV0b1wiLFwidGhlbWVcIjp7XCJwcmltYXJ5XCI6XCIjZWI1NDI0XCJ9LFwibG9nb0RhcmtcIjpcImh0dHBzOi8vY2RuLmljb24taWNvbnMuY29tL2ljb25zMi8yMzg5L1BORy81MTIvZmx1dHRlcl9sb2dvX2ljb25fMTQ1MjczLnBuZ1wiLFwiYXBwVXJsXCI6XCJodHRwczovL3dlYjNhdXRoLmlvXCIsXCJsb2dvTGlnaHRcIjpcImh0dHBzOi8vd3d3LnZlY3RvcmxvZ28uem9uZS9sb2dvcy9mbHV0dGVyaW8vZmx1dHRlcmlvLWljb24uc3ZnXCIsXCJkZWZhdWx0TGFuZ3VhZ2VcIjpcImVuXCIsXCJ1c2VMb2dvTG9hZGVyXCI6dHJ1ZX0iLCJrZXlNb2RlIjoidjEiLCJpc0N1c3RvbVZlcmlmaWVyIjoidHJ1ZSIsInNvY2lhbEZhY3RvckZsb3ciOiIiLCJsb2dpbklkIjoiYmNhMTMwOTIzNTg3MjQ5YjA0MTQ3ZGUwYjJiYjAzYjU2MjgyY2NlZTdiMTJkMDI1ZDYzOGI4YWUxZGJlNDgyZCIsInNlc3Npb25OYW1lc3BhY2UiOiIiLCJ2ZXJzaW9uIjoiNiIsImluc3RhbmNlSWQiOiJtYzY1czgwaTY4OSIsInZlcmlmaWVyIjoiYXV0aDAtand0IiwidHlwZU9mTG9naW4iOiJqd3QiLCJyZWRpcmVjdFRvT3BlbmVyIjpmYWxzZX0”}}}]

which social provider of Auth0 are you using?

I have multiple, Google, Facebook, Apple and Sign in With Ethereum - this error output was from Google, but it is the same with SIWE also - I get the same error no matter what option.

@shahbaz - I have resolved the error regarding the client secret by disabling an action on auth0.

However the final error remains, seems like it is to do with Torus Nodes?

Could not get result from torus nodes - Duplicate token found

{“errorMsg”:“Could not get result from torus nodes \n Duplicate token found”,“errorStack”:“@Web3Auth Error”,“createdAt”:“17/11/2023, 11:40:11”,“info”:{“customAuthState”:{“client”:“BPQgCaSlVcFX03JhY7QUkR0MfX2oUy3d17DF-nvN9txrWI5Of4D6IRB5BEONX34fcQw-hadfJcvSpDV8d1PV75o”,“currentLoginProvider”:“jwt”,“popupWindow”:“false”,“whiteLabel”:“{"logoDark":"https://cdn.icon-icons.com/icons2/2389/PNG/512/flutter_logo_icon_145273.png\“,\“mode\”:\“auto\”,\“useLogoLoader\”:true,\“appUrl\”:\“https://web3auth.io\”,\“defaultLanguage\”:\“en\”,\“logoLight\”:\“https://www.vectorlogo.zone/logos/flutterio/flutterio-icon.svg\”,\“theme\”:{\“primary\”:\”#eb5424\“}}”,“keyMode”:“v1”,“isCustomVerifier”:“true”,“socialFactorFlow”:”“,“loginId”:“6b4451ebef2e2dae2a4547afdd43f17095bc88f3e6f2bed997cef5b2798abeb2”,“sessionNamespace”:”“,“version”:“6”,“instanceId”:“pifigf5hmx9”,“verifier”:“auth0-jwt”,“typeOfLogin”:“jwt”,“redirectToOpener”:false},“customAuthArgs”:{“typeOfLogin”:“jwt”,“verifier”:“auth0-jwt”,“clientId”:“CVhfABkn7gArGzgqUIn85rP8a39j2XkK”,“jwtParams”:{“verifierIdField”:“sub”,“domain”:“https://nftworkx-dev.uk.auth0.com”},“customState”:{“client”:“BPQgCaSlVcFX03JhY7QUkR0MfX2oUy3d17DF-nvN9txrWI5Of4D6IRB5BEONX34fcQw-hadfJcvSpDV8d1PV75o”,“currentLoginProvider”:“jwt”,“popupWindow”:“false”,“whiteLabel”:”{"logoDark":"https://cdn.icon-icons.com/icons2/2389/PNG/512/flutter_logo_icon_145273.png\“,\“mode\”:\“auto\”,\“useLogoLoader\”:true,\“appUrl\”:\“https://web3auth.io\”,\“defaultLanguage\”:\“en\”,\“logoLight\”:\“https://www.vectorlogo.zone/logos/flutterio/flutterio-icon.svg\”,\“theme\”:{\“primary\”:\”#eb5424\“}}”,“keyMode”:“v1”,“isCustomVerifier”:“true”,“socialFactorFlow”:“”,“loginId”:“6b4451ebef2e2dae2a4547afdd43f17095bc88f3e6f2bed997cef5b2798abeb2”,“sessionNamespace”:“”,“version”:“6”},“hash”:“access_token=eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIiwiaXNzIjoiaHR0cHM6Ly9uZnR3b3JreC1kZXYudWsuYXV0aDAuY29tLyJ9…KqYIfeJoKxJgZY2Y.EL-Ixr6qkP5hz8dXp0AwwSZi_C4z0sON3o7U6Rb-MeJ-BoBOMgZ1f-VuVMFddfRRzpqwr1woHfQx57F-KnieokU7oOgWSecWZIGTSBmRkIhSABiz-W85AXdyl2Aiq9E_-Ulyqgglvf-yWEc-y_ypfsR9Dhqm7F8NUzCIPC34XOw5HEhcFRJ3Mrw9WbuJAx1HznDvS3-8oTMCOgxLLiC9rQQEZPad5VKNWhvv8lXAWryWo8vRMmX3nzWAiRlRquoOwAux9RybX9VaxgMYgn1YBlMudRE-oVSI3YsYaYuSXXLR7fgY9dnPxD8OqXNGsKXy6m_Za2qpzA.JQBIucsF-oQxzUPxXaIOBQ&scope=openid%20profile%20email&expires_in=7200&token_type=Bearer&state=eyJjbGllbnQiOiJCUFFnQ2FTbFZjRlgwM0poWTdRVWtSME1mWDJvVXkzZDE3REYtbnZOOXR4cldJNU9mNEQ2SVJCNUJFT05YMzRmY1F3LWhhZGZKY3ZTcERWOGQxUFY3NW8iLCJjdXJyZW50TG9naW5Qcm92aWRlciI6Imp3dCIsInBvcHVwV2luZG93IjoiZmFsc2UiLCJ3aGl0ZUxhYmVsIjoie1wibG9nb0RhcmtcIjpcImh0dHBzOi8vY2RuLmljb24taWNvbnMuY29tL2ljb25zMi8yMzg5L1BORy81MTIvZmx1dHRlcl9sb2dvX2ljb25fMTQ1MjczLnBuZ1wiLFwibW9kZVwiOlwiYXV0b1wiLFwidXNlTG9nb0xvYWRlclwiOnRydWUsXCJhcHBVcmxcIjpcImh0dHB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OiJodHRwczovL25mdHdvcmt4LWRldi51ay5hdXRoMC5jb20vIiwiYXVkIjoiQ1ZoZkFCa243Z0FyR3pncVVJbjg1clA4YTM5ajJYa0siLCJpYXQiOjE3MDAyMjEyMDYsImV4cCI6MTcwMDI1NzIwNiwic3ViIjoiZ29vZ2xlLW9hdXRoMnwxMDc5ODgzMTY3NTk1MTkyNTQxMjkiLCJhdXRoX3RpbWUiOjE3MDAyMjEyMDYsImF0X2hhc2giOiJCVHRFZWs1OUZHN3EwVU1CUlJzaVBnIiwic2lkIjoid0dnRFZ3SnhFenVSVUxQbHE0UEs5STUtdjJfdWpEYkkiLCJub25jZSI6InBpZmlnZjVobXg5In0.vVJCo16wOpDc4kCps9DuylGbicFD6kfTH7GsqauIrv7nMjlceBIhPyQrs4MdAcYhWXIE8mSPexcBS-LYFAbV5YQl6LyCrC5nutoyZfrkJ0b0S0r9rgTjK-k9QcSboR7OODd-PrpB7dF2llIjbfEL01ytyI0h0q51agTcqLZrvI2t1glMVJFMKCihKsDAVsjwPs5jpQxAnvplCIgJfbicbXStqPm7DP4QLW9qjXip19WkroNY4CbMPpHeeJffMqxBsMsrK9ew3ULUyq1XlCJOfcxvaZWjMxCSsEVDhwywjuJbTwkRKUh8N5NjcugBWM15FPbf2wlWRXUeZpQkE6l1bg”,“queryParameters”:{}},“customAuthError”:“Could not get result from torus nodes \n Duplicate token found”,“customAuthHashParams”:{“access_token”:“eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIiwiaXNzIjoiaHR0cHM6Ly9uZnR3b3JreC1kZXYudWsuYXV0aDAuY29tLyJ9…KqYIfeJoKxJgZY2Y.EL-Ixr6qkP5hz8dXp0AwwSZi_C4z0sON3o7U6Rb-MeJ-BoBOMgZ1f-VuVMFddfRRzpqwr1woHfQx57F-KnieokU7oOgWSecWZIGTSBmRkIhSABiz-W85AXdyl2Aiq9E_-Ulyqgglvf-yWEc-y_ypfsR9Dhqm7F8NUzCIPC34XOw5HEhcFRJ3Mrw9WbuJAx1HznDvS3-8oTMCOgxLLiC9rQQEZPad5VKNWhvv8lXAWryWo8vRMmX3nzWAiRlRquoOwAux9RybX9VaxgMYgn1YBlMudRE-oVSI3YsYaYuSXXLR7fgY9dnPxD8OqXNGsKXy6m_Za2qpzA.JQBIucsF-oQxzUPxXaIOBQ”,“scope”:“openid%20profile%20email”,“expires_in”:“7200”,“token_type”:“Bearer”,“state”:“eyJjbGllbnQiOiJCUFFnQ2FTbFZjRlgwM0poWTdRVWtSME1mWDJvVXkzZDE3REYtbnZOOXR4cldJNU9mNEQ2SVJCNUJFT05YMzRmY1F3LWhhZGZKY3ZTcERWOGQxUFY3NW8iLCJjdXJyZW50TG9naW5Qcm92aWRlciI6Imp3dCIsInBvcHVwV2luZG93IjoiZmFsc2UiLCJ3aGl0ZUxhYmVsIjoie1wibG9nb0RhcmtcIjpcImh0dHBzOi8vY2RuLmljb24taWNvbnMuY29tL2ljb25zMi8yMzg5L1BORy81MTIvZmx1dHRlcl9sb2dvX2ljb25fMTQ1MjczLnBuZ1wiLFwibW9kZVwiOlwiYXV0b1wiLFwidXNlTG9nb0xvYWRlclwiOnRydWUsXCJhcHBVcmxcIjpcImh0dHBzOi8vd2ViM2F1dGguaW9cIixcImRlZmF1bHRMYW5ndWFnZVwiOlwiZW5cIixcImxvZ29MaWdodFwiOlwiaHR0cHM6Ly93d3cudmVjdG9ybG9nby56b25lL2xvZ29zL2ZsdXR0ZXJpby9mbHV0dGVyaW8taWNvbi5zdmdcIixcInRoZW1lXCI6e1wicHJpbWFyeVwiOlwiI2ViNTQyNFwifX0iLCJrZXlNb2RlIjoidjEiLCJpc0N1c3RvbVZlcmlmaWVyIjoidHJ1ZSIsInNvY2lhbEZhY3RvckZsb3ciOiIiLCJsb2dpbklkIjoiNmI0NDUxZWJlZjJlMmRhZTJhNDU0N2FmZGQ0M2YxNzA5NWJjODhmM2U2ZjJiZWQ5OTdjZWY1YjI3OThhYmViMiIsInNlc3Npb25OYW1lc3BhY2Ui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AcYhWXIE8mSPexcBS-LYFAbV5YQl6LyCrC5nutoyZfrkJ0b0S0r9rgTjK-k9QcSboR7OODd-PrpB7dF2llIjbfEL01ytyI0h0q51agTcqLZrvI2t1glMVJFMKCihKsDAVsjwPs5jpQxAnvplCIgJfbicbXStqPm7DP4QLW9qjXip19WkroNY4CbMPpHeeJffMqxBsMsrK9ew3ULUyq1XlCJOfcxvaZWjMxCSsEVDhwywjuJbTwkRKUh8N5NjcugBWM15FPbf2wlWRXUeZpQkE6l1bg”}}}

Please refer to this on why this occurs and try to use a unique token on each login request.

Thanks but the code that has been provided on the Github repo doesn’t send that parameter? The entire code base doesn’t have a single reference to “id_token”

extraLoginOptions is on line 250 of the main.dart

Future _withAuth0() {
return Web3AuthFlutter.login(LoginParams(
loginProvider: Provider.jwt,
extraLoginOptions: ExtraLoginOptions(
domain: ‘https://nftworkx-dev.uk.auth0.com’,
verifierIdField: ‘sub’)));
}

vs. FAQ example:

await web3auth.connectTo(WALLET_ADAPTERS.OPENLOGIN, {
loginProvider: “jwt”,
extraLoginOptions: {
id_token: “ID_TOKEN”, // ← JWT should be unique for each request.
verifierIdField: “sub”,
},
});

If you’re using Auth0, you don’t have to pass id_token. The example shown on FAQ is to show that ID_TOKEN should be unique each login request. In Auth0 case, it’s auto managed.

Could you share the console you see on the page where this error is happening?

Check out these to troubleshoot and access the console: