I’m having configuration issue with `application.c...
# ktor
j
I’m having configuration issue with
application.conf
, I declared the following :
Copy code
ktor {
    deployment {
        port = 8080
        port = ${?PORT}
    }
    application {
        modules = [ ... ]
    }
    jwt {
        secret = "secret"
        issuer = "<http://0.0.0.0:8080/>"
        audience = "<http://0.0.0.0:8080/login>"
        realm = "Access to 'login'"
    }
    pbkdf2 {
        salt = "salt"
        iterations = "10000"
        keyLength = "512"
    }
}
when I use
environment.config.property("jwt.secret").getString()
from
Application.kt
I receive this error
Caused by: io.ktor.config.ApplicationConfigurationException: Property jwt.secret not found.
What am I doing wrong here?
d
try to move the
jwt
group outside the
ktor
group:
Copy code
ktor {
    deployment {
        port = 8080
        port = ${?PORT}
    }
    application {
        modules = [ ... ]
    }

    pbkdf2 {
        salt = "salt"
        iterations = "10000"
        keyLength = "512"
    }
}
jwt {
    secret = "secret"
    issuer = "<http://0.0.0.0:8080/>"
    audience = "<http://0.0.0.0:8080/login>"
    realm = "Access to 'login'"
}
👍 3
j
It works, thanks! Somehow the doc gave me the impression everything should be inside the the ktor group
☝️ 1