Please provide the following details too when asking for help in this category:
- SDK Version: 4.0.3 (lastest)
- Screenshots of error:
- Related to Custom Authentication? Please provide the following info too: (Optional)
- Verifier Name:
- JWKS Endpoint:
- Sample idToken(JWT)
Please provide the Web3Auth initialization and login code snippet below:
- init web3:
web3Auth = Web3Auth(
Web3AuthOptions(
context = this,
clientId = getString(R.string.web3auth_project_id), // pass over your Web3Auth Client ID from Developer Dashboard
network = Network.MAINNET, // pass over the network you want to use (MAINNET or TESTNET or CYAN)
redirectUrl = Uri.parse("${applicationId}://auth"), // your app's redirect URL
)
)
// Handle user signing in when app is not alive
web3Auth.setResultUrl(intent?.data)
- login:
private fun signIn() {
val type = intent.getStringExtra(KEY_TYPE_LOGIN)
val email = intent.getStringExtra(KEY_EMAIL)
val selectedLoginProvider = Provider.valueOf(type.orEmpty())
when (type) {
Provider.EMAIL_PASSWORDLESS.name -> {
web3Auth.login(
LoginParams(
Provider.EMAIL_PASSWORDLESS,
extraLoginOptions = ExtraLoginOptions(login_hint = email)
)
).whenComplete { loginResponse, error ->
if (error == null) {
println(loginResponse)
reRender(loginResponse)
} else {
Log.d(LoginWeb3Activity.toString(), error.message ?: "Something went wrong")
}
}
}
else -> {
web3Auth.login(
LoginParams(selectedLoginProvider, extraLoginOptions= null)
).whenComplete { loginResponse, error ->
if (error == null) {
println(loginResponse)
reRender(loginResponse)
} else {
Log.d(LoginWeb3Activity.toString(), error.message ?: "Something went wrong")
}
}
}
}
}