Universal Passkeys for Developers
All devices. Any protocol. Zero shared secrets.
Goodbye, passwords! The Beyond Identity SDKs allow you to embed the Passwordless experience into your product. A set of functions are provided to you through the Embedded namespace. These SDKs supports OIDC and OAuth 2.0.
To enable the retrieval of Cloudsmith hosted packages via Gradle, we need to add the Cloudsmith repository to
the root/build.gradle file.
repositories {
maven {
url "https://packages.beyondidentity.com/public/bi-sdk-android/maven/"
}
}After the repository is added, we can specify the Beyond Identity dependencies.
dependencies {
implementation 'com.beyondidentity.android.sdk:embedded:[version]'
}Check out the Developer Documentation and the SDK API Documentation for more information.
First, before calling the Embedded functions, make sure to initialize the SDK.
import com.beyondidentity.embedded.sdk.EmbeddedSdk
EmbeddedSdk.init(
app: Application,
biometricAskPrompt: String, /* Optional */
logger: (String) -> Unit,
allowedDomains: List<String>? = null, /* Optional */
)Important: For biometric authentication to work, your Activity must extend FragmentActivity (e.g., AppCompatActivity). This is required because Android's BiometricPrompt API requires a FragmentActivity to display the biometric dialog.
Initialization Options:
- The SDK can be initialized from either
Application.onCreate()or from anActivity.onCreate(). - When initializing from an Activity, call
EmbeddedSdk.setActivity(this)immediately afterinit()to provide the current activity for biometric support. - Activity lifecycle callbacks are registered automatically to track activity changes going forward.
// Option 1: Initialize from Application.onCreate()
class MyApplication : Application() {
override fun onCreate() {
super.onCreate()
EmbeddedSdk.init(
app = this,
biometricAskPrompt = "Please verify it's really you",
logger = { Log.d("EmbeddedSdk", it) }
)
}
}
// Option 2: Initialize from Activity (e.g., MainActivity)
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
EmbeddedSdk.init(
app = application,
biometricAskPrompt = "Please verify it's really you",
logger = { Log.d("EmbeddedSdk", it) }
)
// Immediately set the current activity for biometric support
EmbeddedSdk.setActivity(this)
}
}