Please provide the following details too when asking for help in this category:
-
SDK Version: 2.0.3
-
Screenshots of error:
-
Related to Custom Authentication? Please provide the following info too: (Optional)
- Verifier Name: hashtag-bio-passwordless-verifier
- JWKS Endpoint:
- Sample idToken(JWT)
Please provide the Web3Auth initialization and login code snippet below:
static Future initPlatformState() async {
HashMap themeMap = HashMap<String, String>();
themeMap[‘primary’] = “#229954”;
Uri redirectUrl;
if (Platform.isAndroid) {
redirectUrl = Uri.parse('com.hashtag.socialpayme://dev-2tfdd7dzj13ibfel.us.auth0.com/auth');
} else if (Platform.isIOS) {
redirectUrl = Uri.parse('schema://openlogin');
} else {
throw UnKnownException('Unknown platform');
}
HashMap<String, LoginConfigItem> loginConfig =
new HashMap<String, LoginConfigItem>();
loginConfig["jwt"] = LoginConfigItem(
verifier: "hashtag-bio-passwordless-verifier",
typeOfLogin: TypeOfLogin.jwt,
clientId: "my cliiengt id");
await Web3AuthFlutter.init(Web3AuthOptions(
clientId:
'ID',
redirectUrl: redirectUrl,
network: Network.testnet,
loginConfig: loginConfig,
whiteLabel:
WhiteLabelData(dark: true, name: "Social PayMe", theme: themeMap)));
}
static Future withProvider() {
return Web3AuthFlutter.login(LoginParams(
loginProvider: Provider.jwt,
extraLoginOptions: ExtraLoginOptions(
domain: “domain name”,
verifierIdField: “Custom”,
),
mfaLevel: MFALevel.DEFAULT));
}
static Future login(
Future Function() method,BuildContext context) async {
try {
final Web3AuthResponse response = await method();
final prefs = AppDependency.instance.getItInstance.get();
await prefs.setString(_privateKey, response.privKey.toString());
privateKeyValue = response.privKey.toString();
GoRouter.of(context).goNamed(AppRoute.home.routeName);
} on UserCancelledException {
Logger.log(_tag, “User cancelled.”);
} on UnKnownException {
Logger.log(_tag, “Unknown exception occurred”);
}
}