Ping SDKs

Step 2. Configure the projects

In this step you install the dependencies the projects require.

Install the Ping SDK for iOS

This Flutter app requires the native Ping SDK for iOS. Install this by using Swift Package Manager (SPM) on the generated iOS project:

  1. In Xcode, open sdk-sample-apps/flutter/flutter_todo/ios/Runner.xcworkspace.

  2. Select the Runner project and navigate to Package Dependencies.

  3. Click the sign, and add the Ping SDK for iOS repository, https://github.com/ForgeRock/forgerock-ios-sdk.git.

  4. Add the FRCore and FRAuth libraries to the project.

Install Flutter

Next, we need to open and build the Flutter project an IDE such as Android Studio or VSCode.

If you haven’t configured your chosen IDE for Flutter, please follow the guide in the Flutter documentation.

If you are using Android Studio, you should set the Dart SDK path. You can find the Dart SDK in the folder where you downloaded the Flutter SDK. For example, ~/flutter/bin/cache/dart-sdk.

In your IDE, open the flutter_todo project in sdk-sample-apps/flutter/flutter_todo.

When your IDE loads the project and is ready, install any gradle dependencies, and select the iOS simulator to build and run the project:

Running the Flutter project on an iOS simulator in Android Studio
Figure 1. Running the Flutter project on an iOS simulator in Android Studio

Install API server dependencies

Install the TODO Node.JS API server app dependencies by using npm:

  1. In a Terminal window, navigate to the root folder, forgerock-flutter-sample.

  2. Enter npm install.

Configure the API server app

We provide a sample Node.js backend REST API server app that uses a confidential OAuth 2.0 client to contact the authorization server.

The API server handles storage and retrieval of your personal "Todo" items for this tutorial.

  1. In a terminal window, navigate to /sdk-sample-apps/javascript

  2. Install the Node dependencies using npm:

    npm install
  3. Copy the .env.example file in the sdk-sample-apps/javascript/todo-api folder and save it with the name .env within this same directory.

  4. Update the .env file with the details of your server, the port on which to run the API backend server, and details of the confidential client you created earlier:

    Example API server sdk-sample-apps/todo-api/.env file
    SERVER_TYPE='AIC'
    SERVER_URL=https://openam-forgerock-sdks.forgeblocks.com/am
    PORT=9443
    REALM_PATH='ALPHA'
    REST_OAUTH_CLIENT=sdkConfidentialClient
    REST_OAUTH_SECRET=ch4ng3it!
  5. Run the API backend server:

    npm run todo-api

    The API server starts listening on the PORT value you configured: Node server listening on port: 9443.