Page Summary
-
App Flip allows users to quickly link their accounts in your authentication system to their Google accounts by seamlessly flipping to your installed app.
-
This method leverages existing user credentials in your app, eliminating the need for re-entering username and password.
-
To implement App Flip, you must have an Android or iOS app and own or manage an OAuth 2.0 server supporting the authorization code flow.
-
Specific design guidelines must be followed for the account linking consent screen displayed within your app.
-
You can test App Flip using provided sample and test tools before production testing.
借助基于 OAuth 的应用快速关联 (App Flip),您的用户可以轻松快速地将其在您的身份验证系统中的账号与其 Google 账号相关联。如果用户在发起账号关联流程时您的应用已安装在其手机上,系统会将用户顺畅地转到您的应用以获取用户授权。
这种方法可简化关联流程,因为用户无需重新输入用户名和密码即可进行身份验证;相反,App Flip 会利用用户在您应用中的账号凭据。用户将其 Google 账号与您的应用相关联后,便可使用您开发的任何集成。
您可以为 iOS 和 Android 应用设置应用快速关联。
要求
如需实现应用翻转,您必须满足以下要求:
- 您必须拥有 Android 或 iOS 应用。
- 您必须拥有、管理和维护一个支持 OAuth 2.0 授权代码流程的 OAuth 2.0 服务器。
设计准则
本部分介绍了应用翻转账号关联同意屏幕的设计要求和建议。在 Google 调用您的应用后,您的应用会向用户显示同意屏幕。
要求
- 您必须告知用户,其账号将与 Google 关联,而非与 Google Home 或 Google 助理等特定 Google 产品关联。
建议
建议您执行以下操作:
显示 Google 的隐私权政策。在意见征求屏幕上添加指向 Google 隐私权政策的链接。
要分享的数据。使用简洁明了的语言告知用户 Google 需要哪些用户数据以及原因。
明确的号召性用语。在同意屏幕上提供清晰的号召性用语,例如“同意并关联”。这是因为用户需要了解他们必须与 Google 分享哪些数据才能关联其账号。
能够拒绝或取消。如果用户选择不关联,请提供一种供用户返回、拒绝或取消的方式。
能够解除关联。提供一种可供用户取消关联的机制,例如指向您平台上的账号设置的网址。或者,您也可以添加指向 Google 账号的链接,以便用户管理其关联的账号。
能够更改用户账号。建议用户切换账号的方法。如果用户倾向于使用多个账号,此功能尤其有用。
- 如果用户必须关闭同意屏幕才能切换账号,请向 Google 发送可恢复的错误,以便用户可以通过 OAuth 关联和隐式流程登录所需账号。
添加您的徽标。在权限请求页面上显示公司徽标。 根据样式指南放置徽标。如果您还想显示 Google 的徽标,请参阅徽标和商标。
Implement App Flip in your native apps
To implement App Flip, you need to modify the user authorization code in your app to accept a deep link from Google.
To support App Flip on your Android app, follow the instructions on the Android implementation guide.
To support App Flip on your iOS app, follow the instructions on the iOS implementation guide.
Test App Flip
App Flip may be simulated using sample and test apps before verified production apps and a working OAuth 2.0 server are available.
During App Flip a Google app will first open your app which then requests an authorization code response from your OAuth 2.0 server, in the final step the response is returned to the Google app.
Prerequisites
To simulate a Google app and trigger the intent which launches your app, download and install the App Flip Test Tool for Android and iOS.
Download and install the App Flip Sample for Android and iOS To simulate your app and select an OAuth 2.0 response type.
Test sequence
- Open the App Flip Test Tool.
- Press
Try Flip!to launch your App Flip Sample app. - Select a response from the radio buttons in the Sample app.
- Press
Sendto return a simulated OAuth 2.0 response back to the Test Tool. - Check the Test Tool log messages for an auth_code or error details.
Production testing
App Flip may be tested in production after completing registration and your OAuth 2.0 server implementation.
A single Google Account and a task specific email address are recommended for automated testing.
Accounts linking state can be viewed using Linked accounts when signed in as the Google Account holder. Accounts may be unlinked between repeated tests from here as well.
Optionally, you may choose to implement RISC to programmatically unlink and notify Google of the change.