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:
-
In Xcode, open
sdk-sample-apps/flutter/flutter_todo/ios/Runner.xcworkspace. -
Select the Runner project and navigate to Package Dependencies.
-
Click the sign, and add the Ping SDK for iOS repository,
https://github.com/ForgeRock/forgerock-ios-sdk.git. -
Add the
FRCoreandFRAuthlibraries 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, |
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:
Install API server dependencies
Install the TODO Node.JS API server app dependencies by using npm:
-
In a Terminal window, navigate to the root folder,
forgerock-flutter-sample. -
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.
-
In a terminal window, navigate to
/sdk-sample-apps/javascript -
Install the Node dependencies using
npm:npm install -
Copy the
.env.examplefile in thesdk-sample-apps/javascript/todo-apifolder and save it with the name.envwithin this same directory. -
Update the
.envfile 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 serversdk-sample-apps/todo-api/.envfileSERVER_TYPE='AIC' SERVER_URL=https://openam-forgerock-sdks.forgeblocks.com/am PORT=9443 REALM_PATH='ALPHA' REST_OAUTH_CLIENT=sdkConfidentialClient REST_OAUTH_SECRET=ch4ng3it! -
Run the API backend server:
npm run todo-apiThe API server starts listening on the
PORTvalue you configured:Node server listening on port: 9443.