
Okta Mobile Kotlin
Okta Mobile Kotlin is a Kotlin Multiplatform SDK for Okta authentication. The repository centers on KMP libraries for Android and JVM, with a few Android-only support modules and shared sample apps.
Table of Contents
Documentation
New to the SDK? Start with auth-foundation (every library builds on it), then pick the flow
module that matches how you want users to sign in.
Libraries
Sample apps
Repository layout
Publishable libraries
Shared, sample, and internal modules
Installation
Use the BOM to keep versions aligned:
dependencies {
implementation(platform("com.okta.kotlin:bom:3.0.0"))
implementation("com.okta.kotlin:auth-foundation")
implementation("com.okta.kotlin:oauth2")
implementation("com.okta.kotlin:web-authentication-ui")
implementation("com.okta.kotlin:okta-direct-auth")
}
Maven / plain Java projects
The BOM is a Gradle java-platform, which publishes as a standard Maven BOM — import it the same way:
auth-foundation, oauth2, and okta-direct-auth are Kotlin Multiplatform (Android + JVM) artifacts. Their plain <artifactId> (e.g. auth-foundation) resolves to a Gradle-Module-Metadata-only umbrella with no compiled classes — Gradle uses it to auto-select a target, but Maven doesn't understand Gradle Module Metadata's variant resolution, so a Maven build needs to depend on the JVM-target artifact directly, with a -jvm suffix:
See okta-direct-auth-java-cli-sample for a working pure-Java example. web-authentication-ui, legacy-token-migration, and okta-idx-kotlin are Android-only (single-variant AARs) — use their plain <artifactId> as-is, but note they require an Android runtime/toolchain regardless of build tool.
KMP migration
New code should use the KMP APIs in com.okta.authfoundation.client.kmp.*, com.okta.authfoundation.credential.kmp.*, and com.okta.oauth2.kmp.*. See auth-foundation/README.md and oauth2/README.md for the module-specific migration guides and examples.
Building locally
./gradlew build
./gradlew spotlessCheck
./gradlew :auth-foundation:testAndroidHostTest :auth-foundation:jvmTest :oauth2:testAndroidHostTest :oauth2:jvmTest :okta-direct-auth:testAndroidHostTest :okta-direct-auth:jvmTest
Need help?
This library uses semantic versioning and follows Okta's Library Version Policy.
- See the CHANGELOG for the most recent changes, and the releases page for published versions.
- Ask questions on the Okta Developer Forums.
- Report bugs or request features by opening an issue.
If you're migrating from the legacy okta-oidc-android SDK, see migrate.md. (For moving from the deprecated Android-only APIs in this repo to the KMP APIs, see KMP migration above instead.)
Contributing
We are happy to accept contributions and PRs! Please see the contribution guide to understand how to structure a contribution.