Odwrócenie aplikacji

Po wdrożeniu OAuth 2.0 możesz opcjonalnie skonfigurować App Flip oparty na OAuth, który umożliwia użytkownikom Android szybsze łączenie kont w Twoim systemie uwierzytelniania z kontami Google. W sekcjach poniżej opisujemy, jak zaprojektować i wdrożyć App Flip w integracji z Cloud-to-cloud.

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

  1. You must have a Google authorization statement such as "Once linked, Google will have permission to control your devices."
  2. 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.
  3. 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.
  4. 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.
  5. 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:

  1. Display Google's Privacy Policy. Include a link to Google's Privacy Policy on the consent screen.

  2. Data to be shared. Use clear and concise language to tell the user what data of theirs Google requires and why.

  3. 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.

  4. 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.
  5. 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.

This figure shows an example consent screen with call-outs to the
            individual requirements and recommendations to be followed when
            you design a user consent screen.
Figure 1: Account linking consent screen design guidelines.

Konfigurowanie App Flip na podstawie OAuth

W sekcjach poniżej opisujemy wymagania wstępne dotyczące App Flip opartego na OAuth oraz sposób konfigurowania projektu App Flip w Konsoli dewelopera Google Home.

Tworzenie integracji typu Cloud-to-cloud i konfigurowanie serwera OAuth 2.0

Zanim skonfigurujesz App Flip, musisz wykonać te czynności:

Konfigurowanie funkcji przełączania aplikacji w konsoli programisty

W sekcji poniżej opisano, jak skonfigurować App Flip w Konsoli dewelopera.

  1. Wypełnij wszystkie pola w sekcji Informacje o kliencie OAuth. (Jeśli App Flip nie jest obsługiwana, jako opcja zastępcza używana jest zwykła autoryzacja OAuth).
  2. W sekcji Używaj aplikacji do łączenia kont(opcjonalnie) zaznacz Włącz dla iOS.
  3. Wypełnij pole Uniwersalny link. Więcej informacji o linkach uniwersalnych znajdziesz w artykule Zezwalanie aplikacjom i witrynom na linkowanie do Twoich treści.
  4. Jeśli chcesz opcjonalnie skonfigurować klienta, dodaj zakresy i kliknij Dodaj zakres w sekcji Skonfiguruj klienta (opcjonalnie).
  5. Kliknij Zapisz.

Teraz możesz przejść do następnej sekcji, aby wdrożyć App Flip w aplikacji na iOS lub Android.

Implementowanie App Flip w aplikacjach natywnych

Aby wdrożyć App Flip, musisz zmodyfikować kod autoryzacji użytkownika w aplikacji, aby akceptować precyzyjny link z Google.

Testowanie App Flip na urządzeniu

Po utworzeniu integracji typu cloud-to-cloud i skonfigurowaniu funkcji App Flip w konsoli i aplikacji możesz przetestować ją na urządzeniu mobilnym. Aby przetestować przełączanie aplikacji, możesz użyć aplikacji Google Home.

Aby przetestować App Flip w aplikacji Google Home, wykonaj te czynności:

  1. Otwórz Developer Console i wybierz swój projekt.
  2. Otwórz Cloud-to-cloud > Test.
  3. Uruchom proces łączenia konta w aplikacji Home:
    1. Otwórz Google Home app (GHA).
    2. Kliknij przycisk +.
    3. Kliknij Skonfiguruj urządzenie.
    4. Kliknij Masz już skonfigurowane urządzenia?.
    5. Wybierz integrację typu „chmura do chmury” z listy dostawców. Na liście będzie on poprzedzony ciągiem znaków „[test]”. Gdy wybierzesz z listy integrację [test], powinna otworzyć się Twoja aplikacja.
    6. Sprawdź, czy aplikacja została uruchomiona, i zacznij testować proces autoryzacji.