[Archive] Expected URL scheme 'http' or 'https' but no colon was found

:classical_building: Archived Content from Web3Auth Community

This topic was originally posted by nethaji on 8/15/2024.
This content has been migrated from our previous community forum to preserve valuable discussions.


There is an Exception throwed when trying to get keys using custom JWT with below function, and network is on SAPPHIRE_DEVNET.

@RequiresApi(Build.VERSION_CODES.O)
    fun signIn(){
        try {
            val sub = "2cgkq"
            val idToken = "CUSTOM_JWT_TOKEN"
            loginParams = LoginParams("test-app", sub, idToken)
            torusKey = singleFactorAuth.getKey(
                loginParams,
                context,
                86400
            ).get()
            publicAddress = torusKey?.publicAddress.toString()
            Log.d("Web3Auth", """Private Key: ${torusKey?.privateKey?.toString(16)}""".trimIndent())
        } catch (e: ExecutionException) {
            Log.d("Web3Auth", e.message.toString())
        } catch (e: InterruptedException) {
            Log.d("Web3Auth", e.message.toString())
        }
    }

Exception:

java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: Expected URL scheme 'http' or 'https' but no colon was found

Hey @nethaji can you share the Android SFA version you are using, also is this exception triggered when you are doing getKey?

I’m using the following versions in my project:

implementation 'com.github.Web3auth:single-factor-auth-android:0.4.0'
implementation 'org.torusresearch:fetch-node-details-java:5.0.0'

And yes, I’m encountering an exception when I call getKey."

The error you are getting is more of HTTP url not being correct, not sure if it’s from Web3Auth. I’ll try our example. Can you get the stack trace for the error?

Hey, I tried to reproduce the error. It’s working fine, can you please share the detail stack trace for the error?