Social login is popular among customers due to a faster registration process (almost no additional information is needed), and you can save the time of remembering all your accounts. However, before creating a social login in Magento 2, you have to connect to the API of other social networks such as Google, Facebook, Yahoo, Instagram, Pinterest, etc. Today, we will show you how to configure Google API in Magento 2.
When entering Twitter, you need to create an external application to connect your website to Google API. Then, application ID and secret (Client ID and secret or API ID and Secret), or application credentials, are all that we need. With this external application, your website will be linked to API. And these credentials play an important role in making Google users get access to your website.
To Configure Google API, let’s follow these steps:
1. Firstly, let’s enter //console.developers.google.com and sign in your Google account. We start to configure Google API in Magento 2 here.
2. Then, on the Dashboard sidebar, choose Credentials tab which is on the left side, and click Create button to create a new project.
3. Fill in all the fields like project name, and choose Yes for two fields below, then click Create.
4. After clicking Create button, wait for a minute, choose the tab OAuth consent screen beside Credentials Tab, and then fill in all the information about your website or your product such as Product name, Home page URL, Product Logo URL, etc. After that, press Save.
5. In the Tab Credentials, click Create Credentials then choose OAuth Client ID.
6. After creating client ID, a pop-up showing your client ID and client secret will appear like the image below.
7. Now, after getting your Client ID and secret, copy and paste them into API fields in Magento 2 back-end interface as an admin.
In this post, we have shown you how to configure Google API in Magento 2. Follow us if you want to know how to do the same with other social networks’ APIs!