Sobald Sie eine OAuth 2.0-Implementierung haben, können Sie optional OAuth-basierte App Flip konfigurieren. So können Android-Nutzer ihre Konten in Ihrem Authentifizierungssystem schneller mit ihren Google-Konten verknüpfen. In den folgenden Abschnitten wird beschrieben, wie Sie App Flip für Ihre Cloud-to-cloud-Integration entwerfen und implementieren.
Design guidelines
This section describes the design requirements and recommendations for the App Flip account linking consent screen. After Google calls your app, your app displays the consent screen to the user.
Requirements
- You must have a Google authorization statement such as "Once linked, Google will have permission to control your devices."
- You must communicate that the user's account is being linked to Google, not to a specific Google product, such as Google Home or Google Assistant.
- You must state a clear call-to-action on your consent screen and use the wording "Agree and link" for linking action. This is because users need to understand what data they're required to share with Google to link their accounts.
- You must provide a way for users to go back or cancel, if they choose not to link. Use the wording "Cancel" for the cancel action.
- You must implement this workflow: After clicking "Agree and link", you must show linking success and redirect the user back to the Google Home app automatically. The user should now see the linked device on the Google Home app with your action. After clicking "Cancel" you should redirect the user back to the Google Home app.
Recommendations
We recommend that you do the following:
Display Google's Privacy Policy. Include a link to Google's Privacy Policy on the consent screen.
Data to be shared. Use clear and concise language to tell the user what data of theirs Google requires and why.
Ability to unlink. Offer a mechanism for users to unlink, such as a URL to their account settings on your platform. Alternatively, you can include a link to Google Account where users can manage their linked account.
Ability to change user account. Suggest a method for users to switch their account(s). This is especially beneficial if users tend to have multiple accounts.
- If a user must close the consent screen to switch accounts, send a recoverable error to Google so the user can sign in to the desired account with OAuth linking and the implicit flow.
Include your logo. Display your company logo on the consent screen. Use your style guidelines to place your logo. If you wish to also display Google's logo, see Logos and trademarks.
OAuth-basierte App Flip einrichten
In den folgenden Abschnitten werden die Voraussetzungen für den App-Wechsel auf Grundlage von OAuth beschrieben und es wird erläutert, wie Sie Ihr App-Wechsel-Projekt in der Google Home Developer Console konfigurieren.
Cloud-to-Cloud-Integration erstellen und OAuth 2.0-Server einrichten
Bevor Sie App Flip konfigurieren können, müssen Sie Folgendes tun:
- Richten Sie einen OAuth 2.0-Server ein. Weitere Informationen zum Einrichten eines OAuth-Servers finden Sie unter OAuth 2.0-Server implementieren.
- Cloud-zu-Cloud-Integration erstellen Folgen Sie der Anleitung unter Cloud-zu-Cloud-Integration erstellen, um eine Integration zu erstellen.
App Flip in der Developer Console konfigurieren
Im folgenden Abschnitt wird beschrieben, wie Sie App Flip in der Entwicklerkonsole konfigurieren.
- Füllen Sie alle Felder unter OAuth-Clientinformationen aus. Wenn App Flip nicht unterstützt wird, wird als Fallback reguläres OAuth verwendet.
- Setzen Sie unter App für die Kontoverknüpfung verwenden(optional) ein Häkchen bei Für iOS aktivieren.
- Füllen Sie das Feld Universeller Link aus. Weitere Informationen zu universellen Links finden Sie unter Apps und Websites erlauben, auf Ihre Inhalte zu verlinken.
- Wenn Sie Ihren Client optional konfigurieren möchten, fügen Sie Bereiche hinzu und klicken Sie unter Client konfigurieren (optional) auf Bereich hinzufügen.
- Klicken Sie auf Speichern.
Sie können jetzt mit dem nächsten Abschnitt fortfahren, um App Flip in Ihrer iOS- oder Android-App zu implementieren.
App Flip in nativen Apps implementieren
Um App Flip zu implementieren, müssen Sie den Nutzerautorisierungscode in Ihrer App so ändern, dass ein Deeplink von Google akzeptiert wird.
App Flip auf Ihrem Gerät testen
Nachdem Sie eine Cloud-to-Cloud-Integration erstellt und App Flip in der Console und in Ihrer App konfiguriert haben, können Sie App Flip auf Ihrem Mobilgerät testen. Mit der Google Home App können Sie App Flip testen.
So testen Sie App Flip über die Google Home App:
- Rufen Sie die Developer Console auf und wählen Sie Ihr Projekt aus.
- Gehen Sie zu Cloud-to-Cloud > Testen.
- Workflow zur Kontoverknüpfung über die Home App starten:
- Öffnen Sie die Google Home app (GHA).
- Klicken Sie auf die Schaltfläche +.
- Klicken Sie auf Gerät einrichten.
- Klicken Sie auf Du hast schon Geräte eingerichtet?.
- Wählen Sie Ihre Cloud-zu-Cloud-Integration aus der Liste der Anbieter aus. In der Liste wird das Präfix „[test]“ vorangestellt. Wenn Sie Ihre [Test]-Integration in der Liste auswählen, sollte Ihre App geöffnet werden.
- Prüfen Sie, ob Ihre App gestartet wurde, und beginnen Sie mit dem Test Ihres Autorisierungsablaufs.