To simplify your integration with Google APIs, OAuth 2.0 protocol is used. You can either use an API key or an OAuth 2.0 client ID.
This guide list down the steps of creating an API key:
- Go to Google Cloud Platform Console.
- Login with your Gmail account credentials.
- From the dropdown, click on Select a project situated at the top. You can either select a project from the list of existing ones or create a new one. When creating a new project, make sure to give it a proper name of your choice.
- Then, select this project and go to the dashboard.
- Look for Google+ API and enable it.
- From the left sidebar, select APIs & Services >> Credentials.
- Click on Create Credentials.
- Where will you be calling the API from? Choose: Web Browser (JavaScript)
- What data will you be accessing? Choose: User Data
- Click on What Credentials do I need?
- Create an OAuth 2.0 client ID
- Give name to your credential
- Authorized redirect URIs: In this section please write: yoursite/login (e.g. http://mydomain.com/login)
- Set up the OAuth 2.0 consent screen
- Setup you email address
- Enter product name which will be shown to user during login
- You can now either download the key or simply click on done.
- Now click on the recently created credential. On detail page you will find your client ID and secret.