Step 5. Configure the SDK
Add the configuration
If you run the project at this stage, you will see an emptyConfiguration
message in the debug area.
The FRAuth
SDK requires a configuration file (usually named FRAuthConfig.plist
) to retrieve information about the PingAM instance and the OAuth 2.0 client.
To add a configuration File
-
Right-click the
DemoApp
project folder in your workspace, and select New File. -
Select iOS, then scroll down to Resource.
-
Select Property List and click Next.
-
Save the file as
FRAuthConfig.plist
and select Create. -
Right-click on the file and select Open As > Source Code.
-
Replace the existing file content with the following:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>forgerock_oauth_client_id</key> <string>sdkPublicClient</string> <key>forgerock_oauth_redirect_uri</key> <string>https://sdkapp.example.com:8443/callback</string> <key>forgerock_oauth_scope</key> <string>openid profile email address</string> <key>forgerock_oauth_threshold</key> <string>60</string> <key>forgerock_url</key> <string>https://openam.example.com:8443/openam</string> <key>forgerock_cookie_name</key> <string>iPlanetDirectoryPro</string> <key>forgerock_realm</key> <string>alpha</string> <key>forgerock_timeout</key> <string>60</string> <key>forgerock_auth_service_name</key> <string>sdkUsernamePasswordJourney</string> <key>forgerock_registration_service_name</key> <string>Registration</string> </dict> </plist>
Ensure your values match your environment; especially
forgerock_url
andforgerock_cookie_name
.The URL string for
forgerock_url
must match the URL you set in your PingAM cloud instance. -
Save your changes.
-
Right-click the file, and select Open As > Property List.
The Property List provides a clear view of the property values.
-
Edit the values to match your PingAM server settings configuration.
For
forgerock_realm
, if PingAM is local, set toroot
. If PingAM is in the Cloud, set toalpha
.The SDK validates the information in the configuration file. For information about the configuration options in the file, see Step 4. Configuration file properties.
If you use a different configuration file name, specify the configuration file name before you initialize the SDK. You might use a different name if you are using multiple configurations to test multiple environments.
Specify the configuration file name as follows:
FRAuth.configPlistFilename = "DemoApp"
-
Save your changes.
-
Run the application again.