We are using a common KMM module inside our new Multiplatform app, but we got stuck at authentication using Ktor Client.
At first, everything worked fine in Android using Base64 class from java.util, but once we tried to build the project for iOS, and macOS, the big trouble began. Since java.util is not available there, we need to find a way to decode the JWT token to read its payload, expiration date, etc.
I believe there might be a good way to handle JWT tokens when authenticating via Ktor client.
Using expect and actual was one of the things that came to my mind.
However, it only worked fine for Android, but things got stuck for iOS and macOS.
It seems like the Swift methods and classes that are needed to be used for Base64 decoding, cannot be used in a Kotlin module!