Add Passage
Add Passage to your Android project
Prerequisites
A recent version of Android Studio
Make sure that your project meets these requirements:
Targets API level 33 or higher
Uses Android 13 or higher
A Passage account (register for free if you haven’t already)
A Passage app (if you don't have one, learn how to create one here)
A device or emulator that meets passkey requirements (if your app uses passkeys)
If you don't already have an Android project and just want to try out Passage, you can clone our Android Example App.
Add the Passage SDK
In your module (app-level) Gradle file (usually <project>/<app-module>/build.gradle
), add the Passage dependency like this, and then sync your Android project with Gradle files:
Declare an instance of Passage
.
In your Activity’s onCreate()
or Fragment’s onViewCreated
method, initialize the Passage
instance.
If you are NOT using passkeys, that's it - you're ready to start using Passage!
If you ARE using passkeys, follow the below instructions
Configure app for passkeys
Step 1: Add your Android app in Passage Console
In the Passage Console, navigate to "Native Apps" and add your Android app. You'll need your app's package name and signing certificate fingerprint.
Generate signing certificate fingerprint
To get your signing certificate fingerprint, copy and paste this code in your terminal, replacing the placeholder all caps values:
Need help with finding or using your certificate? Learn more here.
Step 2: Publish Digital Asset Links file
Google's Digital Asset Links protocol enables an app or website to make public, verifiable statements about other apps or websites. Your website must declare that it is associated with your specific Android app, and declare that it wants to share user credentials in order for passkey authentication to work.
Get asset links JSON file
Click the menu button on your Native App in Passage Console to download your assetlinks.json
file.
Publish asset links JSON file
Publish this file to your site’s .well-known/
directory. Note that your Passage app's authentication origin must match the domain where this file is hosted.
Step 3: Configure asset statements
In your app’s strings.xml
file, copy and past the following, replacing YOUR_AUTH_ORIGIN
:
Finally, paste the following meta-data
into your app’s AndroidManifest.xml
:
Last updated