https://kotlinlang.org logo
#ktor
Title
# ktor
f

fkrauthan

09/07/2020, 2:36 AM
Now I have a ktor client specific question. If I develop a custom feature (that does for example some custom authentication logic/signing of payloads) but needs to use user specific details (my app is multi user capable). How would I go about that? Would I need to create a new client instance for each user and then pass the specific client credentials as part of the Feature setup? Or is there are a better way. For Feign client I for example used ThreadLocal to pass in this information. So before calling the HttpClient I was setting the ThreadLocal with the required info. is there something similar for ktor client and ktor client Features?
j

jorge.rego

09/07/2020, 7:22 AM
so you want to know how to build the server or how to do both, client and server?
f

FranSoto

09/07/2020, 8:50 AM
my server need to use a SSO to validate and obtains my users' info and i created a new client
f

fkrauthan

09/07/2020, 6:21 PM
I want to know how can I add dynamic arguments (that I populate for example as part of a route) so that a feature within a ktor client can read it
E.g. passing along who is currently authenticated from the server REST endpoint to a ktor-client external API call
3 Views