Ping SDKs

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

  1. Right-click the DemoApp project folder in your workspace, and select New File.

  2. Select iOS, then scroll down to Resource.

  3. Select Property List and click Next.

  4. Save the file as FRAuthConfig.plist and select Create.

  5. Right-click on the file and select Open As > Source Code.

  6. 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 and forgerock_cookie_name.

    The URL string for forgerock_url must match the URL you set in your PingAM cloud instance.

  7. Save your changes.

  8. Right-click the file, and select Open As > Property List.

    The Property List provides a clear view of the property values.

  9. Edit the values to match your PingAM server settings configuration.

    For forgerock_realm, if PingAM is local, set to root. If PingAM is in the Cloud, set to alpha.

    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"
  10. Save your changes.

  11. Run the application again.

Copyright © 2010-2024 ForgeRock, all rights reserved.