How do I perform `Bearer` authentication with <#C0...
# ktor
a
How do I perform
Bearer
authentication with #ktor ? I see that there is basic, jtw, etc, but there is no option for simply checking the bearer token.
o
I think you have to manually set the header for that.
r
I'm not sure if I understand your question correctly, but shouldn't the OAuth Provider be responsible for authentication?
Where for JWT you can do this in KTor itself, but for OAuth this will be done by the 3rd party
a
no, i want to use
Bearer
tokens
I'm also using JJTW and ktor uses Auth0's JWT implementation so it is not an option for me
it is also very hard to customize
i want to use JWTs for form authentication and API authentication as well
d
if you’re using JWT then you can hook into jwt’s
authHeader
to return an HttpAuthHeader - doesn’t matter where you get it from. You can extract it from the ApplicationCall.
if you’re not using JWT, then you probably have to write your own
AuthenticationProvider
(which is not very hard)
a
I'm using JWT, but not the one provided by Ktor (i'm using JJWT)
d
on the ktor side?
a
yep