Assume that there is a requirement to set up a public login to an apex application using Facebook and Google.

Using the Social Sign-In feature user can log in to an apex application using Google and Facebook account. Here we are going to look at how we can integrate Facebook authentication for an apex application. For enabling this feature, you have to create a Facebook API initially. after the successful creation of this API Facebook will provide an App ID and an App secret or password. You have to create a web credential using these credentials within apex. Later you have to create a custom authentication scheme for login. You can follow the below steps to achieve this.

Steps to Follow

The following steps explain in detail,

Step 1: Create a Facebook API.

For creating an API you have to log in to Facebook’s developer console. Create an App using the button Create App.

Step 2:

Go to Settings ->Basic

There you can see the App ID and App Secret. It will be used to create the web credential in the Apex application later.

Step 3:
Go to Facebook Login -> Settings.

You have to enable Client OAuth Login and add https://apexea.oracle.com/pls/apex/apex_authentication.callback Valid OAuth Redirect URIs.

Step 4:

 Create a sample Apex application and go to Shared Components and select the Web credential link for creating a new web credential.

Here you have to enter the App ID, App secret that we have created earlier, and other details as shown in the below picture.

Step 5:  Create an Authentication Scheme using Authentication Scheme Link in Shared Components. Please ensure to opt for Social Sign-in for the scheme type and Facebook for Authentication Provider. Also, we have to map our created web credentials in the field of the credential store.

So we have finished with our development and we can test.

While opening the application you will get a page for entering the credentials.

Once you have entered the credentials correctly it will leads you to the apex application.

Recent Posts

Start typing and press Enter to search