Hi, I just managed to deploy my ktor-server-app to...
# ktor
t
Hi, I just managed to deploy my ktor-server-app to heroku. After a lot of struggle it finally worked šŸ™ƒ. One thing however is not working. I hope somebody can help. I use jwt for authorization. I followed exactly this guide https://ktor.io/docs/jwt.html using RS256 (public/private) key pair. Everything worked on localhost but on Heroku public key cannot be found. (More in Thread)
On localhost this configuration worked just fine: jwt { privateKey = "PrivateKey" issuer = "http://0.0.0.0:8080/" audience = "http://0.0.0.0:8080/hello" realm = "Access to 'hello'" } But on Heroku I get the following error: com.auth0.jwk.SigningKeyNotFoundException: Failed to get key with kid 346899ed-9189-488f-9011-0ff4b6c08xyz Caused by: java.util.concurrent.ExecutionException: com.auth0.jwk.NetworkException: Cannot obtain jwks from url https://myherokudomain/.well-known/jwks.json What do I have to use for issuer? Anyone?
a
You can use Herokuā€™s config variables if you know your applicationā€™s domain before deployment to reference them in a Ktor application config.