Has anyone gotten Compose for Web working with Okt...
# compose-web
k
Has anyone gotten Compose for Web working with Okta authentication?  Only thing I've dug up is this thread: https://devforum.okta.com/t/support-for-android-jetpack-compose-kotlin/16511 None of the examples here seem to hook into npm libraries unlike the KotlinJS examples: https://compose-web.ui.pages.jetbrains.team/ Basically wondering if it's possible to do OIDC auth to grab a JWT token to do API calls to a backend in Compose for Web...
g
I'm not sure about Okta, but I've used Amazon Cognito which uses the Oauth2 standard, in combination with a compose for web frontend. But the problem is independent of using Compose for Web or some other framework for the user interface. I used ktor to access the various http endpoints needed to get access tokens, refresh tokens, etc. I couldn't find a Kotlin implementation of an Oauth2 client that could be used in the browser (i.e. not dependent on JVM libraries), so I guess I sort of wrote my own minimum implementation to do what I needed.
If that's something people think would be generally useful, I could open source it, but it likely needs work to become a general-purpose Oauth2 client library (and some good review to ensure best-practices are maintained, security wise). It's only a few hundred lines of code.
k
Was hoping there would be some interop with JS libs in Compose for Web... But what you described would work...can probably port a Java/Android version of their SDK too. 🤔