创建 Google Social Connect 社交登录教程

702次阅读
没有评论

登录 Google Developers Console

首先,您需要登录您的 Google 帐户,然后访问 Google Developers Console

创建 Google Social Connect 社交登录教程

选择一个项目

登录并访问 Google Developers Console 后,单击“选择项目”菜单项。

创建 Google Social Connect 社交登录教程

创建项目

单击“选择项目”菜单项后,将出现一个弹出窗口。我们需要点击“新建项目”。

创建 Google Social Connect 社交登录教程

设置项目

单击“新建项目”后,我们需要为项目选择一个名称。完成设置项目后,单击“创建”。

创建 Google Social Connect 社交登录教程

Create Credentials

To use the Google API we need to Create Credentials. Click on “Credentials” to get started.

创建 Google Social Connect 社交登录教程

After clicking on “Credentials” we will need to create an OAtuh 2.0 client ID. Click on “OAuth consent screen”.

创建 Google Social Connect 社交登录教程

Create an OAuth 2.0 client ID

Step 1: Choose from the following options and then click on “Create”:

  • Internal – only available to users within your organization.
  • External – available to any user with a Google Account.

创建 Google Social Connect 社交登录教程

Step 2: After clicking on “Create” we will need to set the following options:

Page1: OAuth consent screen

  • Application name – The name of the app asking for consent
  • User support email – For users to contact you with questions about their consent
  • Application logo – Optional
  • Application Homepage page – Optional until you deploy your app
  • Application Privacy Policy link – Optional until you deploy your app
  • Application Terms of Service link – Optional
  • Authorized domains – Optional until you deploy your app
  • Email address – These email addresses are for Google to notify you about any changes to your project.

Click Save and Continue

创建 Google Social Connect 社交登录教程Page2: Scopes

  • Your non-sensitive scopes- you should add the following 3 scopes

Click Save and Continue

创建 Google Social Connect 社交登录教程

Page 3: Test Users

Click Save and Continue

创建 Google Social Connect 社交登录教程Page 4: Summary

Click Save and Continue

创建 Google Social Connect 社交登录教程

Step 3: Go to “ Credentials” → “Create credentials” → “OAuth client ID”

创建 Google Social Connect 社交登录教程

Step 4: Choose your Application type.

创建 Google Social Connect 社交登录教程

Step 5: We will need to set the following options:

• Name – add your own name
• Authorized JavaScript – add your website url – Example: http://www.yourdomain.com
• Authorized redirect URLs – add your website url – Example: http://www.yourdomain.com

After you finish click on “Create”.

创建 Google Social Connect 社交登录教程

Client ID Credentials

After clicking on “Create” you will be prompted with your Client ID Credentials. You will need to copy the Client ID and click on “Done”. You will also need to copy the name of your OAuth 2.0 client.

创建 Google Social Connect 社交登录教程

粘贴 Google 客户端 ID

复制 Google 客户端 ID 后,转到您的网站 -> 仪表板 -> 配置文件生成器 -> Social Connect -> 启用 Google 登录并粘贴您的客户端 ID 和 OAuth 2.0 客户端的名称。滚动到底部以保存。

创建 Google Social Connect 社交登录教程

前端的 Google 登录

Social Login with Google应该在WordPress默认和配置文件生成器表单上可用。

创建 Google Social Connect 社交登录教程

正文完
 0
评论(没有评论)

觅站网

Posts

Sed cras ornare arcu dui vivamus arcu felis. Cursus euismod quis viverra nibh cras pulvinar mattis nunc.

Melissa Meiers