The Apex is now allowing the user to login with a Google account. This Social Sign-In feature is introduced in Apex 18.1 version.

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 how we can integrate google authentication for an apex application.

For enabling this feature, you have to create a Google API initially. after the successful creation of this API Google will provide a client id and a client 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.

Steps to follow

The below steps will explain all these in detail.

Step 1:

Create a Google API.

For creating you have to login into Google’s Developers console. then Create a project to enable the APIs you need to perform the login process.

You have to opt OAuth clent ID while choosing credentials. You can give a name for the application and enter https://apexea.oracle.com/pls/apex/apex_authentication.callback  in the Authorized redirect URIs field.

Hope you can see a Client Id and a Secret now in the Credential tab of the google console now.

 

Step 2 :

Create a sample Apex application and goto Shared Components and select Web credential link for creating a web credential.

Here you have to enter the client id, client credential and other details as shown in the below picture.

Step3 :

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

 

 

 

So now you have successfully integrated the google login for the apex application. Now you can run the application and see the result.

 

Recent Posts

Start typing and press Enter to search