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

Kedar

02/27/2022, 1:43 AM
I'm implementing authentication using JWT and new requirement of supporting Google/Facebook/Apple login may come very soon. Is there any easy way to build these using OAuth by keeping the existing JWT authentication for normal email/password login flows?
i

ishitatsuyuki

02/27/2022, 4:55 AM
Ktor is pretty unopinionated about authentication (unlike Spring which is pretty much impossible to configure for any multi-provider setup). How do you store the JWT token? As a cookie or as a local storage item and then passed through Authorization? Either way, you can do pretty much anything inside the OAuth callback handler: redirect, set cookie, save session etc. https://ktor.io/docs/oauth.html#redirect-route
21 Views