接入指南:自带登录凭据Guide: bring your own login credentials
印信替你的站点处理登录,但 Google 登录和微信登录必须使用你自己申请的凭据:登录页上用户看到的是你的应用名和 logo,授权也记在你的账号下。没有提供自己的凭据时,印信不会替你提供这两项登录服务。填好之后立即生效,不需要重新部署,也不需要找印信的人重启服务。
Yinxin handles sign-in for your site, but Google and WeChat sign-in must use credentials that you register: users see your app name and logo on the consent screen and the authorization belongs to your account. Without your own credentials the platform does not provide these two sign-in methods for you. Once saved they apply immediately, with no redeploy and no restart.
需要准备的材料
- 一个 Google 账号(建议用公司共用邮箱注册,避免个人离职后失控)
- 应用名称(用户在授权页看到的名字)
- 客服邮箱:一个能收信的邮箱,建议使用你自己域名下的邮箱
- 你的站点域名,以及印信登录地址的域名(下面会显示)
- 应用 logo(可选;上传后 Google 可能要求先做品牌验证,会多等几天,不急可先不传)
- 隐私政策与服务条款网页地址(可选,上线给公众用之前建议准备)
What to prepare
- A Google account (use a shared company mailbox, not one person's)
- An app name (shown on the consent screen)
- A support email that receives mail, ideally on your own domain
- Your site's domain and the Yinxin sign-in domain (shown below)
- An app logo (optional; Google may require brand verification before showing it)
- Privacy-policy and terms URLs (optional, recommended before public launch)
申请步骤
- 打开 console.cloud.google.com,登录后在顶部项目选择器里点「新建项目」,项目名随意(例如你的产品名),创建并切换到这个项目。
- 左侧菜单进入「API 和服务」→「OAuth 同意屏幕」,或直接搜索「Google Auth Platform」,点「开始使用」。
- 品牌 (Branding):填应用名称、用户支持邮箱;「已获授权的网域」里填你的站点主域名和印信登录地址的主域名(下方「需要填入的值」里有);开发者联系邮箱填一个能收信的地址;logo 可选。
- 目标对象 (Audience):选「外部」。
- 只请求 openid、email、profile 三项基础信息(登录默认就是这三项)。它们不属于敏感范围,不需要提交 Google 的应用验证。
- 「目标对象」页的发布状态:新建时是「测试中」,此时只有你登记的测试用户能登录(最多 100 个)。准备让真实用户登录时,点「发布应用」切到「正式版」。仅用基础信息登录,通常不需要等待审核。
- 进入「客户端 (Clients)」→「创建客户端」,应用类型选「Web 应用」,名称随意。在「已获授权的重定向 URI」里逐字填入下方的回调地址(一个字符都不能差,包括 https 和结尾)。
- 创建后会弹出客户端 ID 和客户端密钥。密钥请立即复制或下载,Google 之后不再显示完整内容。
- 回到印信:应用 →「登录方式」→ Google →「改为自有品牌」,把客户端 ID、客户端密钥、回调地址填进去保存。密钥只写入密钥库,保存后页面只会显示「已配置」和末四位。
- 用一个测试账号走一遍登录。若 Google 报「redirect_uri_mismatch」,说明第 5 步的回调地址与下面的值不一致,回去核对。
Steps
- Open console.cloud.google.com, sign in, use the project picker at the top to create a new project (any name), then switch to it.
- Go to APIs & Services → OAuth consent screen, or search for "Google Auth Platform", and click Get started.
- Branding: app name, user support email; under Authorized domains add your site's root domain and the Yinxin domain (values below); a developer contact email; logo is optional.
- Audience: choose External.
- Request only openid, email and profile. These are non-sensitive scopes and need no Google app verification.
- Publishing status on the Audience page starts as Testing: only listed test users (up to 100) can sign in. Click Publish app to move to In production before real users arrive. With basic scopes this normally needs no review wait.
- Go to Clients → Create client, type Web application. Under Authorized redirect URIs add the callback below exactly, character for character.
- Google shows the Client ID and Client secret. Copy or download the secret now; Google will not show it in full again.
- Back in Yinxin: App → Sign-in methods → Google → Use own brand. Enter client ID, client secret and the callback, then save. The secret goes only to the secret store; the page afterwards shows "configured" and the last four characters.
- Sign in once with a test account. A redirect_uri_mismatch error means the callback in step 5 differs from the value below.
需要填入的值Values to enter
需要准备的材料
- 企业营业执照(扫描件或清晰照片)
- 对公银行账户,用于接收微信打款验证的小额款项
- 认证服务费 300 元(按年续费)
- 企业管理员或经办人的身份信息与手机号
- 已完成 ICP 备案的网站域名,以及网站能正常打开的官网地址
- 应用名称、应用简介
- 应用图标(按开放平台页面提示的尺寸和格式准备)
- 一个接收注册和审核通知的邮箱
What to prepare
- Company business licence (scan or clear photo)
- A corporate bank account to receive the verification micro-payment
- The CNY 300 verification fee (renewed yearly)
- Identity details and phone number of the company admin or contact
- An ICP-filed domain and a working website URL
- App name and short description
- App icon (size and format as the Open Platform page requires)
- A mailbox for registration and review notices
申请步骤
- 打开 open.weixin.qq.com,点「注册」,用邮箱注册开放平台账号并激活,账号类型选「开发者」。
- 进入「账号中心」,完成「开发者资质认证」,主体选企业。依次提交营业执照、管理员信息,然后按页面提示向对公账户打款验证(微信会给对公账户打一笔小额款项,回填金额即通过),并支付 300 元认证费。认证一般几个工作日内完成。
- 认证通过后进入「管理中心」→「网站应用」→「创建网站应用」。填写应用名称、简介、图标、官网地址。官网域名必须已备案。
- 授权回调域一栏,填下方「授权回调域」的值,只填域名,不带 https:// 和路径。
- 提交审核。审核通常 1 到 7 个工作日,结果会发到注册邮箱。被驳回时按原因修改后重新提交。
- 审核通过后,在应用详情页可以看到 AppID,并可以生成 AppSecret。AppSecret 只在生成时完整显示一次,请立即复制保存;弄丢只能重置。
- 回到印信:应用 →「登录方式」→ 微信扫码 →「改为自有品牌」,把 AppID、AppSecret 填进去保存。回调地址按下方的值填写。密钥只写入密钥库,保存后页面只显示「已配置」和末四位。
- 用手机微信扫码走一遍登录。若提示 redirect_uri 参数错误,说明授权回调域与实际回调地址的域名不一致,回到第 4 步核对。
Steps
- Open open.weixin.qq.com, click Register, sign up with an email and activate the account as a developer.
- In the account center complete Developer Qualification Verification as a company: submit the business licence and admin details, confirm the micro-payment to the corporate bank account (enter the amount WeChat sends), and pay the CNY 300 fee. This normally takes a few working days.
- After approval go to Management Center → Website Apps → Create. Enter app name, description, icon and website URL. The website domain must be ICP-filed.
- In Authorization callback domain enter the value below, domain only, no https:// and no path.
- Submit for review. Review takes 1 to 7 working days; the result is emailed. If rejected, fix the stated reason and resubmit.
- Once approved the app page shows the AppID and lets you generate the AppSecret. The AppSecret is shown in full only when generated; copy it at once. If lost it can only be reset.
- Back in Yinxin: App → Sign-in methods → WeChat QR → Use own brand. Enter AppID and AppSecret, use the callback below, and save. The secret goes only to the secret store; the page afterwards shows "configured" and the last four characters.
- Scan the QR code with WeChat on a phone. A redirect_uri error means the callback domain differs from the actual callback address; recheck step 4.
需要填入的值Values to enter
保存之后After saving
保存即生效,不用重启。新增的站点流程是:创建应用 → 在「登录方式」里为 Google、微信分别填入自己的凭据 → 用测试账号各登录一次。密钥换新只需在同一处重新填写,旧密钥立即作废。关闭某种登录方式用「关闭」,登录页会隐藏它。
Saving takes effect immediately; nothing restarts. For a new site: create the app, enter your own Google and WeChat credentials under Sign-in methods, then sign in once with each. To rotate a secret, enter the new one in the same place; the old one stops working at once. Use Off to hide a method from the login page.