We provide the social login for Facebook, Gmail and LinkedIn. For that we have to provide id, secret key and callback url in the .env file.
For Facebook, register your app here then click on settings on sidenav.
From the basic settings you will be able to access your API key and API secret.
Also, click the Add Platform button below the settings configuration. Select Website in the platform dialog then enter the website URL, in our case it is ( http://demo.joshadmin.com/ )
Set the App Domains to your site url, privacy policy and terms of service url (http://demo.joshadmin.com\ and choose the category as Business then save the settings.
Then Click on App Review tab ->Choose Yes For Make Your Site Public.
Now Click the Add Product tab on settings from sidenav and add the facebook login.
Next Click on Facebook Login ->Client OAuth Settings Section select yes for all except Use Strict Mode For Redirect URLS. and Enter Valid OAtuth Redirect URLS(http://demo.joshadmin.com/facebook/callback/ )choose yes for login from devices.
then save.
Note: The values of FACEBOOK_ID, FACEBOOK_SECRET and FACEBOOK_URL should be set in your .env file. The FACEBOOK_URL in this case will be (http://demo.joshadmin.com/facebook/callback ):
For Google, Creating a Google API Console project and clientID
Before you can integrate Google Sign-In into your website, you must have a Google API Console project. In the project, you create a client ID, which you need to call the sign-in API.
To create a Google API Console project and client ID, follow these steps:
From the project drop-down, select an existing project , or create a new one by selecting Create a new project.
In the sidebar under "APIs & Services", select Credentials, then select the OAuth consent screen tab.
`a).Choose An Email Address, specify a Product Name and press save.`
In the Credentials tab, Select the Create Credentials drop-down list and choose OAuth client ID.
Under Application type, select Web application.
Register the origins from which your app is allowed to access the Google APIs, as follows. An origin is a unique
combination of protocol, hostname, and port.
In the Authorized JavaScript origins field, enter the origin for your app. You can enter multiple origins to allow for your app to run on different protocols, domains, or subdomains. You cannot use wildcards. In the example below, the second URL could be a production URL.
From the resulting OAuth client dialog box, copy the client id. The Client Id lets your app access enabled Google APIs.
For LinkedIn, Please Follow The Steps
To connect your Auth0 app to LinkedIn, you will need to generate a Client ID and Client Secret into your Auth0 settings, and enable the connection.
A TRY icon will now be displayed next to the LinkedIn logo:
Click TRY.
You will see the LinkedIn Authorize screen, click Allow to finish creating the connection.
If you have configured everything correctly, you will see the It works!!! page:
Access LinkedIn API
Once you successfully authenticate a user, LinkedIn includes an access token in the user profile it returns to Auth0.
You can then use this token to call their API.
In order to get a LinkedIn access token, you have to retrieve the full user's profile, using the Auth0 Management API, and extract the access token from the response. For detailed steps refer to Call an Identity Provider API.
Once you have the token you can call the API, following LinkedIn's documentation.