When asking for help in this category, please make sure to provide the following details:
- SDK Version: 3.1.0
- Platform: Android
- Browser Console Screenshots:
- If the issue is related to Custom Authentication, please include the following information (optional):
- Verifier Name: googel_provider
- JWKS Endpoint:
- Sample idToken (JWT):
Also, kindly provide the Web3Auth initialization and login code snippet below. This will help us better understand your issue and provide you with the necessary assistance.
HashMap themeMap = HashMap<String, String>();
themeMap['primary'] = "#229954";
Uri redirectUrl;
if (Platform.isAndroid) {
redirectUrl = Uri.parse(_androidRedirectUrl);
} else if (Platform.isIOS) {
redirectUrl = Uri.parse(_iosRedirectUrl);
} else {
throw UnKnownException('Unknown platform');
}
HashMap<String, LoginConfigItem> loginConfig =
new HashMap<String, LoginConfigItem>();
loginConfig["jwt"] = LoginConfigItem(
verifier: "googel_provider",
typeOfLogin: TypeOfLogin.jwt,
clientId: _auth0ClientId);
await Web3AuthFlutter.init(Web3AuthOptions(
clientId:
_web3ClientId,
redirectUrl: redirectUrl,
network: Network.testnet,
loginConfig: loginConfig,
whiteLabel:
WhiteLabelData(mode:ThemeModes.dark, appName: "Social PayMe", theme: themeMap)));
await Web3AuthFlutter.initialize();
Future<Web3AuthResponse> withProvider() {
return Web3AuthFlutter.login(LoginParams(
loginProvider: Provider.google,
extraLoginOptions: ExtraLoginOptions(
domain: _authDomain,
verifierIdField: "Sub",
),
mfaLevel: MFALevel.DEFAULT));
}
@override
Future<bool> signIn({Map<String, dynamic> parameters=const {}}) async{
try {
final Web3AuthResponse response = await (parameters[Parameters.method.name] as Future<Web3AuthResponse> Function())();
credentials = response.userInfo;
Logger.log(_tag, "token after sign in: ${credentials?.oAuthIdToken}");
Logger.log(_tag, "token after sign in: ${credentials?.oAuthAccessToken}");
Logger.log(_tag, "token after sign in: ${credentials?.idToken}");
return true;
} on UserCancelledException {
Logger.log(_tag, "User cancelled.");
return false;
} on UnKnownException {
Logger.log(_tag, "Unknown exception occurred");
return false;
}
}
I want to get jwt token and use it for api call, but not geeting oAuthAccessToken, oAuthIdToken which help me get jwt token and refresh jwt token from Auth APIs