Create the Google app and insert the required details in the pop-up box of Google Social Login to enable and use it during log-in and/or user registration.
Create the Google App #
- Navigate to https://console.developers.google.com/apis/
- Log in using your Google credentials
- You will need a project.
- If you don’t have a project, then you need to create one. Proceed by clicking the blue “Create Project” text on the right.
- If you already have a project then navigate to the top bar and click the name of the project, which will bring up a modal. Proceed by clicking “New Project“.
- Name your project and then click on the “Create” button again.
- Once you have a project, you will end up in the dashboard.
If you already have a Project, make sure you select the created project in the top bar.
- Click the “OAuth consent screen” button on the left-hand side
- Choose a User Type according to your needs and press “Create“.
- If you want to enable the Google Social Login for any users with a Google account, pick the “External” option.
- In the “App name” field, enter a name for your app. This will appear as the name of the app asking for consent.
- For the “User support email” field, select an email address that users can use to contact you with questions about their consent.
- Fill in the “Application home page” field with the URL of your homepage (e.g. https://sitename.com)
- Enter your Privacy Policy and Terms of Service links into the “Application privacy policy link” and “Application terms of service link” fields
- Under the “Authorized domains” section, click the “Add Domain” button and enter your domain name without subdomains (e.g. bbplatform.ddev.site)
- At the “Developer contact information” section, enter an email address that Google can use to notify you about any changes to your project.
- Click the “Save and Continue“. Click this again on the “Scopes“, and “Test users” pages.
Create Credentials #
- On the left side, click on the “Credentials” menu point, then click the “+ Create Credentials” button on the top bar
- Choose the “OAuth client ID” option
- Select the “Web application” under Application type
- Enter a “Name” for your OAuth client ID
- Under the “Authorized redirect URIs” section, click “Add URI” and add the below URL:
https://sitename.com/wp-login.php?wp_social_login=google - Click on the “Create” button
- A modal should pop up with your credentials
- If this doesn’t happen, go to the Credentials in the left-hand menu and select your app by clicking on its name. You can copy and paste the “Client ID” and “Client Secret” from there
Publish the App #
- At this point, your app is in Testing mode, so only a limited number of people can use it. To allow this app for any user with a Google account:
- Click on the “OAuth consent screen” option on the left side
- Then click the “PUBLISH APP” button under the “Publishing status” section
- Lastly, click the “Confirm” button