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

Peter Tran

10/14/2020, 8:00 PM
Hi! Question about ktor and multiplatform. I see OAuth2 support is provided by the code in
ktor-features/ktor-auth
. However, all of the source is under
jvm/
. Is there a particular dependency on JVM? Or is there some other reason this cannot be common code and reused on a native platform?
c

Casey Brooks

10/14/2020, 8:14 PM
I think you may be looking at the ktor server auth feature (which is currently JVM-only). The repo structure is a bit confusing, but looks like there is an Auth feature for clients in common code https://github.com/ktorio/ktor/blob/7e524156e0357763595dde457d8c922627b8def7/ktor-client/ktor-client-features/ktor-client-auth/common/src/io/ktor/client/features/auth/Auth.kt
p

Peter Tran

10/14/2020, 8:25 PM
Hi Casey.. so the features provided in
ktor-client-auth
are Basic Auth and Digest Auth, but these are different from OAuth2.
In the folder I mentioned,
ktor-features/ktor-auth,
there is a function called verifyWithOAuth2 which is definitely a client feature, and I verified this with an Android instrumentation test. But now I need to run this from native / mingw64.
I created a youtrack ticket.
7 Views