Hello, there is way to protect a route with an API...
# ktor
m
Hello, there is way to protect a route with an API-KEY header?
d
m
Yes, but it's for authentication and return a UserIdPrincipal. Here, I just want to check if the api-key header is set and the value is valid.
d
This sounds like a custom pipeline intercepter
m
it looks like, thank @Dennis Schröder!
d
You’re welcome
k
the UserIdPrincipal doesn't actually have to be a real user id...
you could just return
UserIdPrincipal(apiKey)
b
@mmaillot Sorry to bother you in this old thread, but how did you solve it?