Skip to content

Asgardeo Android SDK

The Asgardeo Auth Android SDK enables Android applications (written in Kotlin) to utilize OpenID Connect (OIDC) authentication with Asgardeo serving as the Consumer Identity and Access Management (CIAM) Provider through application-native authentication.

This SDK assists you in creating custom login flows directly within the applications themselves, without relying on browser redirects, thereby prioritizing user experience.

Requirements and recommendations

  • An Android application written in Kotlin programming language.
  • The minimum supported SDK is API level 26, compiled to API level 34. However, there are certain limitations when using specific authentication methods:
    • Passkeys are only supported on API level 34 and above.
    • Google authentication using the Credential Manager API is supported on API level 34 and above.

Getting Started

Prerequisites

Installing the SDK

  1. Open the build.gradle file of your Android application and add the following dependency to add the latest released SDK.

    groovy
    dependencies {
        implementation("io.asgardeo:asgardeo-android:<latest-version>")
    }

    You can find the latest version of the SDK from the Maven Repository.

  2. Add a redirect scheme in the Android application. You need to add the appAuthRedirectScheme in the application build.gradle file.

    This should be consistent with the CallBack URL of the Service Provider that you configured in the Asgardeo.

    For example, if you have configured the CallBack URL as wso2.apiauth.sample.android://oauth2, then the appAuthRedirectScheme should be wso2.apiauth.sample.android.

    groovy
    android.defaultConfig.manifestPlaceholders.putAll(
        mapOf(
            "appAuthRedirectScheme" to "wso2.apiauth.sample.android",
            "callbackUriHost" to "",
            "callbackUriScheme" to ""
        )
    )