Thank you very much for a too-the-point answer. I am able to access the JSON Web Key and I have also fed it into JWTAuth.create and now the JWTCreate is not throwing any exception. However, provider.authenticate always fails to authenticate it even though I am using an authenticated JWT token which is being sent from frontend.
I used following way to create JWTAuth object.
var jsonObject = JsonObject("<I Copied all contents of Json Web Key here.>")
var provider = JWTAuth.create(myvertx, jsonObject)
Then I used
var idJson = JsonObject()
idJson.put("jwt", myJWTToken)
var optionsJson = JsonObject()
optionsJson.put("ignoreExpiration",true)
idJson.put("options", optionsJson)
provider.authenticate(idJson, { asyncresult ->
println("Is authenticated = ${asyncresult.succeeded()}")
})
But when I tried using Vertx way of providing public key using PubSecKeyOptions and JWTAuthOptions, by copying the key from the OneLogin certs URL, It threw an exception saying "InvalidKeyException"
Caused by: java.security.InvalidKeyException: IOException: DerInputStream.getLength(): lengthTag=71, too big.
at sun.security.x509.X509Key.decode(X509Key.java:398)
at sun.security.x509.X509Key.decode(X509Key.java:403)
at sun.security.rsa.RSAPublicKeyImpl.<init>(RSAPublicKeyImpl.java:86)
at sun.security.rsa.RSAKeyFactory.generatePublic(RSAKeyFactory.java:298)
at sun.security.rsa.RSAKeyFactory.engineGeneratePublic(RSAKeyFactory.java:201)
... 51 more