Ayfri
06/17/2023, 11:13 PMBasicAuthCredentials
but I'm having weird results, as in the function I'm querying username/password from a storage, but it appears to only query it on the first request that requires auth, then never again, not updating the values used by BasicAuthCredentials
.
Here is my code :
install(Auth) {
basic {
credentials {
val username = storage["username"] ?: ""
val password = storage["password"] ?: "" // will only get the values the first time
if (username.isEmpty() || password.isEmpty()) null
else BasicAuthCredentials(username, password)
}
realm = "Login"
}
}
Even putting logs in this lambda shows that it's only called once, but then, how do I tell my Ktor to update its credentials ?Aleksei Tirman [JB]
06/19/2023, 9:39 AMAyfri
06/19/2023, 9:51 AM