Configure Facebook as an Identity Provider
Number of APIs: 11
PingOne supports several external identity providers, including Facebook. A sign-on policy configuration in PingOne for Facebook as an identity provider allows users to authenticate and gain access to a configured application using the Facebook sign-on flow and their Facebook credentials.
If the client secret has been updated, you must also update the client secret in both the PingOne configuration for the OIDC external identity provider, and the external OpenID provider.
Note: To specify Facebook as an external identity provider, you must have Facebook's application ID and application secret property values. You can find this information on the Facebook for developers portal.
This scenario illustrates the following common operations supported by the PingOne APIs:
- Create an identity provider configuration
- Create an optional identity provider attribute mapping
- Create a population for Facebook users
- Create a sign-on policy
- Create a sign-on policy action
- Create an application
- Associate the sign-on policy with the application
Prerequisites
Get an access token from the worker application that you created in Getting Started with the PingOne APIs. To get a token from a different worker application in an alternate sandbox environment, run the token request endpoint using the client ID and client secret of your chosen worker app to authenticate the request. For more information, see GET a Worker Application Access Token.
Workflow order of operations
To create a sign-on policy that specifies Facebook as a supported external identity provider, the following tasks must be completed successfully:
Make a
POST
request to/environments/{{envID}}/identityProviders
to create the identity provider configuration for Facebook.Make a
POST
request to/environments/{{envID}}/identityProviders/{{providerID}}/attributes
to map the Facebookemail
attributes to PingOneemail
attributes. This step is optional.Make a
POST
request to/environments/{{envID}}/populations
to create a population for users who will use their Facebook credentials to sign on.Make a
POST
request to/environments/{{envID}}/signOnPolicies
to create a new sign-on policy.Make a
POST
request to/environments/{{envID}}/signOnPolicies/{{policyID}}/actions
to create a new LOGIN sign-on policy action, which is associated with the new sign-on policy.Make a
POST
request to/environments/{{envID}}/applications
to add a new application to the specified environment.Make a
GET
request to/environments/{{envID}}/resources
to return a list of all resource entities associated with the specified environment to get the ID for the PingOne platform resource.Make a
GET
request to/environments/{{envID}}/resources/{{resourceID}}/scopes
to list all scopes associated with a specified resource (the PingOne platform resource).Make a
POST
request to/environments/{{envID}}/applications/{{appID}}/grants
to create a new resource access grant for the application.Make a
POST
request to/environments/{{envID}}/applications/{{appID}}/signOnPolicyAssignments
to associate the sign-on policy with the application.Make a
POST
request to/{{envID}}/as/authorize
to obtain an authorization grant. This request starts the authorization flow.
-
Step 10: Assign the sign-on policy to an application POST {{apiPath}}/environments/{{envID}}/applications/{{FacebookAppID}}/signOnPolicyAssignments
-
Step 1: Create the new identity provider resource POST {{apiPath}}/environments/{{envID}}/identityProviders
-
Step 2: Create an optional attribute mapping POST {{apiPath}}/environments/{{envID}}/identityProviders/{{facebookIdpID}}/attributes
-
Step 3: Create a population for Facebook users POST {{apiPath}}/environments/{{envID}}/populations
-
Step 4: Create the new sign-on policy POST {{apiPath}}/environments/{{envID}}/signOnPolicies
-
Step 5: Create the sign-on policy action POST {{apiPath}}/environments/{{envID}}/signOnPolicies/{{facebookIdpPolicyID}}/actions
-
Step 6: Create an application POST {{apiPath}}/environments/{{envID}}/applications
-
Step 7: Get the list of resources GET {{apiPath}}/environments/{{envID}}/resources
-
Step 8: Get all scopes GET {{apiPath}}/environments/{{envID}}/resources/{{p1ResID}}/scopes
-
Step 9: Create the application's resource access grant POST {{apiPath}}/environments/{{envID}}/applications/{{FacebookAppID}}/grants