Passage and the Passage Flutter SDK were built to make passkey authentication as fast, simple, and secure as possible. This example application is a great place to start. Before using Passage in your own Flutter app, you can use this example app to:
- Plug in your own Passage app credentials to see passkeys in action
- Learn basic implementation of the Passage Flutter SDK
A successful registration flow will look like this:
- Android Studio Electric Eel or newer
- Xcode 14 or newer
- A Passage account and Passage app (you can register for a free account here)
- Completed setup of
- Associated Domains file (iOS) (view instructions)
- Asset Links file (Android) (view instructions)
- Key hash registration (Android) (view instructions)
flutter pub add passage_flutter
To get this example Flutter app working with your Passage account/app, you'll need to swap out the placeholder authentication origin with your own. Learn more about Passage auth origins here.
You'll need to replace YOUR_AUTH_ORIGIN
in the Associated Domains file (found here).
<plist version="1.0">
<dict>
<key>com.apple.developer.associated-domains</key>
<array>
<string>webcredentials:YOUR_AUTH_ORIGIN</string>
<string>applinks:YOUR_AUTH_ORIGIN</string>
</array>
</dict>
</plist>
In the strings.xml
file (found here) replace YOUR_AUTH_ORIGIN
with your app’s auth origin.
<resources>
<!-- Required Passage app settings -->
<string name="passage_auth_origin">YOUR_APP_ORIGIN</string>
...
</resources>
When you're running the web app locally you'll want to make sure your Passage app auth origin and Flutter web app port are set to the same localhost.
Lastly, replace YOUR_APP_ID
in the passage_state_container.dart
file here.
_passage = PassageFlutter('YOUR_APP_ID');
If all of the configuration was setup correctly, you should be able to run this application in the simulator or a real device!