使用 Azure Active Directory B2C 设置通过 QQ 帐户注册与登录Set up sign-up and sign-in with a QQ account using Azure Active Directory B2C

备注

此功能目前以公共预览版提供。This feature is in public preview.

创建 QQ 应用程序Create a QQ application

要将 QQ 帐户用作 Azure Active Directory B2C (Azure AD B2C) 中的标识提供者,需要在表示它的租户中创建一个应用程序。To use a QQ account as an identity provider in Azure Active Directory B2C (Azure AD B2C), you need to create an application in your tenant that represents it. 如果还没有 QQ 帐户,可以在 https://ssl.zc.qq.com/en/index.html?type=1&ptlang=1033 注册。If you don't already have a QQ account, you can sign up at https://ssl.zc.qq.com/en/index.html?type=1&ptlang=1033.

注册 QQ 开发人员计划Register for the QQ developer program

  1. 使用 QQ 帐户凭据登录 QQ 开发人员门户Sign in to the QQ developer portal with your QQ account credentials.
  2. 登录后,请转到 https://open.qq.com/reg 将自己注册为开发者。After signing in, go to https://open.qq.com/reg to register yourself as a developer.
  3. 选择“个人” (individual developer)。Select 个人 (individual developer).
  4. 输入所需的信息,并选择“下一步” (next step)。Enter the required information and select 下一步 (next step).
  5. 完成电子邮件验证过程。Complete the email verification process. 注册为开发人员后,需要等待几天,以获得批准。You will need to wait a few days to be approved after registering as a developer.

注册 QQ 应用程序Register a QQ application

  1. 转到https://connect.qq.com/index.htmlGo to https://connect.qq.com/index.html.
  2. 单击“应用管理” (app management)。Select 应用管理 (app management).
  3. 选择“创建应用” (create app),然后输入所需的信息。Select 创建应用 (create app) and enter the required information.
  4. 在“授权回调域” (callback URL) 中输入 https://your-tenant-name.b2clogin.cn/your-tenant-name}.partner.onmschina.cn/oauth2/authrespEnter https://your-tenant-name.b2clogin.cn/your-tenant-name}.partner.onmschina.cn/oauth2/authresp in 授权回调域 (callback URL). 例如,如果 tenant_name 是 contoso,请将 URL 设置为 https://contoso.b2clogin.cn/contoso.partner.onmschina.cn/oauth2/authrespFor example, if your tenant_name is contoso, set the URL to be https://contoso.b2clogin.cn/contoso.partner.onmschina.cn/oauth2/authresp.
  5. 选择“创建应用” (create app)。Select 创建应用 (create app).
  6. 在确认页上选择“应用管理” (app management) 返回应用管理页。On the confirmation page, select 应用管理 (app management) to return to the app management page.
  7. 选择刚刚创建的应用旁边的“查看” (view)。Select 查看 (view) next to the app you created.
  8. 选择“修改” (edit)。Select 修改 (edit).
  9. 复制“应用 ID” 和“应用密钥” 。Copy the APP ID and APP KEY. 将标识提供者添加到租户时需要这两个值。You need both of these values to add the identity provider to your tenant.

将 QQ 配置为标识提供者Configure QQ as an identity provider

  1. 登录到 Azure 门户Sign in to the Azure portal.
  2. 在门户工具栏中选择“目录 + 订阅”图标,然后选择包含 Azure AD B2C 租户的目录 。Select the Directory + Subscription icon in the portal toolbar, and then select the directory that contains your Azure AD B2C tenant.
  3. 在 Azure 门户中,搜索并选择“Azure AD B2C” 。In the Azure portal, search for and select Azure AD B2C.
  4. 选择“标识提供者” ,然后选择“QQ (预览)” 。Select Identity providers, then select QQ (Preview).
  5. 输入“名称” 。Enter a Name. 例如,QQ 。For example, QQ.
  6. 对于客户端 ID,输入你之前创建的 QQ 应用程序的应用 ID。For the Client ID, enter the APP ID of the QQ application that you created earlier.
  7. 对于客户端密码,输入你记录的应用密钥。For the Client secret, enter the APP KEY that you recorded.
  8. 选择“保存” 。Select Save.