Ping SDKs

Authentication journey tutorial for an iOS Flutter app

This tutorial covers the basics of developing a protected mobile app with Flutter. It focuses on developing the iOS bridge code along with a minimal Flutter UI to authenticate a user.

Bridge code development is a concept common to mobile apps built using hybrid technologies. Hybrid is a term used when a portion of the mobile app uses a language that is not native to the platform (Android and Java or iOS and Swift).

Flutter is an open source framework by Google for building beautiful, natively compiled, multi-platform applications from a single codebase. Flutter requires this bridging code to provide the hybrid layer (Dart) access to native APIs (Swift in this case) or dependencies.

This guide uses the Ping SDK to implement the following application features:

  1. Authentication through a simple journey/tree.

  2. Requesting OAuth/OIDC tokens.

  3. Requesting user information.

  4. Logging a user out.

flutter todos screen
Figure 1. The to-do sample app

Before you begin

Before you begin this tutorial ensure you have set up your PingOne Advanced Identity Cloud tenant or PingAM server with the required configuration.

For example, you will need to configure CORS, have an OAuth 2.0 client application set up, as well as an authentication journey for the app to navigate.

Step 1. Download the samples

To start this tutorial, you need to download the SDK sample apps repo, which contains the projects you will use.

Step 2. Configure the projects

In this step you install the dependencies the projects require, and configure the connection properties.

Step 3. Configure connection properties

In this step, you configure the samples to connect to the authentication tree/journey and OAuth 2.0 client you created when setting up your server configuration.

Step 4. Build and run the project

Build and run the apps, and learn about Hot Module Reloading.

Step 5. Implement the iOS bridge code

In this step you implement the bridge code and add methods for starting the Ping SDK, logging a user in, stepping through a journey, and finally logging a user out.

Step 6. Implement the UI in Flutter

In this final step you implement the user interface for logging in, and code for submitting the forms. You will also handle returning to the list view, requesting user info, and handling logout triggers.

This is also the moment you can try out the fully functioning app.