Using the Authentication feature, is there a way t...
# ktor
c
Using the Authentication feature, is there a way to get the credentials during a normal call, I must check if a specific user is allowed to can a specific api or not....
d
b
What @Dennis Schröder wants to say with this link:
You can get the generated Principal instance inside your handler with:
Copy code
val principal: UserIdPrincipal? = call.authentication.principal<UserIdPrincipal>()
😎 1
c
yes but what If i am in a route already where i can access a call only
any other way to retrieve "authentication" ?
sorry u are right
i can access it
never mind, thanks.
j
call.user will return user 😉