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.
Table of Contents
How to Configure Google API in Magento 2 with 7 step
To Configure Google API, let’s follow these steps:
Firstly, let’s enter https://console.developers.google.com/ and sign in your Google account. We start to configure Google API in Magento 2 here.
Fill in all the fields like project name, and choose Yes for two fields below, then click Create.
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.
In the Tab Credentials, click Create Credentials then choose OAuth Client ID.
After creating client ID, a pop-up showing your client ID and client secret will appear like the image below.
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!