Is there a way to have a route with optional authe...
# ktor
c
Is there a way to have a route with optional authentication? I have a specific route that both users and anonymous clients can access.
e
Maybe a bad idea but, you could create an auth provider that always succeeds authenticating and add that to the route since the
authenticate
function can be called with multiple configurations.
They actually have functionality for this…
Just add the parameter for optional
It will give you a
null
principal according to the documentation.
c
I have to give it to them that in insight it was extremely easy to find.