Step 2. Configure the sample app
In this step, you configure the "FRExample" app to connect to the OAuth 2.0 application you created in PingFederate, using the centralized login method.
-
In Xcode, on the File menu, click Open.
-
Navigate to the
sdk-sample-apps
folder you cloned in the previous step, navigate toiOS
>uikit-frexamples
>FrExample
>FrExample
>FRExample.xcodeproj
, and then click Open. -
In the Project Navigator pane, navigate to FRExample > FRExample, and open the
ViewController
file. -
In the
ViewController
file:-
Change the
useDiscoveryURL
variable totrue
:let useDiscoveryURL = true
Changing the variable causes the sample to use the
discover
method to get many of the required configuration values from your PingFederate OIDC.well-known
endpoint. -
Replace
CLIENT_ID_PLACEHOLDER
with the ID of the OAuth 2.0 client application you created previously in PingFederate:let config = ["forgerock_oauth_client_id": "sdkPublicClient", "forgerock_oauth_redirect_uri": "org.forgerock.demo://oauth2redirect", "forgerock_oauth_scope" : "openid profile email address", "forgerock_ssl_pinning_public_key_hashes": ["SSL_PINNING_HASH_PLACEHOLDER"]]
-
Remove or comment out the
forgerock_ssl_pinning_public_key_hashes
line.For information on SSL pinning, refer to Enable SSL pinning.
-
Replace
DISCOVERY_URL_PLACEHOLDER
with the.well-known
endpoint from your PingFederate server.The
.well-known
endpoint is the base URL of your PingFederate server, with/.well-known/openid-configuration
appended.How do I find my PingFederate Base URL?
To verify the base URL of your PingFederate server:
-
Log in to your PingFederate administration console.
-
Navigate to
. -
Make a note of the Base URL value.
For example,
https://pingfed.example.com
Do not use the admin console URL.
For example:
let discoveryURL = "https://pingfed.example.com/as/.well-known/openid-configuration"
-
-
For more information, refer to Editing an application - OIDC.
With the sample configured, you can proceed to Step 3. Run the sample app and perform centralized login.