Skip to content

passageidentity/example-flutter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Passage logo

Example Flutter App with Passage Auth

🔑 The easiest way to get passkeys up and running for Flutter

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:

Passage Flutter Example

Requirements

  • 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

Installation

flutter pub add passage_flutter

Configuration

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.

iOS

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>

Android

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>

Web

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.

Final step

Lastly, replace YOUR_APP_ID in the passage_state_container.dart file here.

_passage = PassageFlutter('YOUR_APP_ID');

🚀 Run the app!

If all of the configuration was setup correctly, you should be able to run this application in the simulator or a real device!