IdTokenVerifier's verify method stalling out
mikeluz opened this issue · 1 comments
I'm trying to use the out-of-the-box ID Token verifier (from the "Verifying an ID Token signed with the RS256 signing algorithm" section in the README) and the verify method is stalling out:
val publicKeyProvider = PublicKeyProvider("$domain/")
val sigVerifier = SignatureVerifier.forRS256(publicKeyProvider)
val idTokenVerifier = IdTokenVerifier.init("$domain/", clientId, sigVerifier).build()
var token = body.getString(TOKEN) // body is JsonObject with key "token" -> token
return try {
logger.info("Verifying...")
idTokenVerifier.verify(token)
true
} catch (idtve : IdTokenValidationException) {
idtve.printStackTrace()
logger.error("Token invalid.")
false
} catch (e: Exception) {
e.printStackTrace()
false
}
And getPublicKeyById impl:
override fun getPublicKeyById(keyId: String) : RSAPublicKey? {
val provider = JwkProviderBuilder(domain).build()
return try {
provider.get(keyId).publicKey as RSAPublicKey?
} catch (e: Exception) {
e.printStackTrace()
null
}
}
The token itself is the "__raw" token value extracted using getIdTokenClaims() in the ReactJS Quickstart app.
During setup I worked through some errors related to domain/client issuer/audience so I'm guessing it's not related to those values, although I can provide all but the client secret if it will help.
When execution reaches the idTokenVerifier.verify(token) line the program just stops, like it's in an infinite loop or the entire program is waiting on a Future to resolve. No errors etc. just hangs.
com.auth0.auth0-1.19.0
Kotlin Vert.X
Intellij IDEA
MacOSX
Hey @mikeluz were you able to resolve this? Is there any more context you can share?