Sign in with Google and Apple
Let customers sign in to their store account with their Google or Apple account, beside the e-mail code.
On the store's sign-in page, a customer can get a code by e-mail or, once you switch it on, click Entrar com Google or Entrar com Apple (the storefront speaks Portuguese). They need no password and no code. After this page you know how to create the store's app with Google and with Apple, paste its keys in the admin and switch the buttons on.
Before you start
- Each store uses its own app with Google and Apple. Mobiari has no shared app: without the store's keys, the buttons do not show.
- Have the store's domain published. The return addresses you register with Google and Apple use the store's domains (see Online store).
- Setting it up needs the permission to edit the online store.
- Apple requires an Apple Developer Program account, which is paid. Google charges nothing.
Where it is
Open Grow → Online store and pick the Google and Apple sign-in view. There is a box for Google and one for Apple. Each says whether it is On, Set up, off or Not set up, and lists the Return addresses to register, one per store domain, with a copy button.
Set up Google
- In the Google Cloud Console, create or pick a project and set up the OAuth consent screen with the store's name and logo.
- Under APIs & Services → Credentials, create an OAuth client ID of type Web application.
- Under Authorized redirect URIs, paste each address from Return addresses to register in the admin.
- Copy Google's Client ID and Client secret.
- In the admin, in the Google box, paste the Client ID and the Client secret, switch on Show the Sign in with Google button and click Save.
Set up Apple
- In the Apple developer account, under Certificates, Identifiers & Profiles, create an App ID with Sign in with Apple ticked.
- Create a Services ID, tick Sign in with Apple and, in its configuration, pick the App ID. Under Domains and Subdomains, register the store's domains (the admin lists them). Under Return URLs, paste each address from Return addresses to register.
- Under Keys, create a key with Sign in with Apple and download the
.p8file. Apple lets you download it only once: keep the file. - In the admin, in the Apple box, fill in the Services ID (the identifier, such as
com.yourstore.signin), the Team ID (10 characters, in the corner of the developer account) and the Key ID (10 characters, next to the key). - Under Private key (.p8), paste the file's content or use Or pick the .p8 file.
- Switch on Show the Sign in with Apple button and click Save.
Google's client secret and Apple's private key are stored encrypted and never shown again in the admin. To replace one, type a new one. Leaving the field blank keeps the saved one.
What the customer sees
With a provider on, the sign-in page shows its button above the e-mail field. The customer clicks it, signs in to their Google or Apple account and comes back to the store already signed in, on the page they were on.
- Already a customer: if Google or Apple confirmed the e-mail and the store already has a customer with that e-mail, the account is linked to that customer. Orders, addresses and wallet are all there.
- New customer: a new e-mail becomes a new customer in the CRM, with the name the provider sent.
- Apple's hidden e-mail: someone who picks Hide My Email signs in with an Apple address that forwards messages. The store gets that address, not the personal one.
- A Google account with another service's e-mail: Google vouches only for Gmail addresses and for company addresses on Google Workspace. Someone whose Google account uses an Outlook address, for example, confirms that address once: the sign-in page asks for the e-mail code and then goes back to Google and links the account. This way nobody gets into another customer's account with an address that used to be theirs.
- No confirmed e-mail: if the provider does not confirm the e-mail, the sign-in page says so and the customer signs in with the e-mail code.
Once linked, the account signs in with the same button even if the e-mail changes at Google or Apple.
Switch off or remove
- Switch off Show the Sign in with Google button (or Apple) and click Save to take the button away without deleting the keys.
- Remove deletes the store's keys and takes the button away. People who signed in with it keep their accounts and sign in with the e-mail code.
When a customer asks for their data to be erased, the link to Google or Apple is erased too.
Common problems
- The button does not show: check that the box is On. A provider with an empty field cannot be switched on.
- Google shows "redirect_uri_mismatch": that domain's return address is not among the Authorized redirect URIs. Copy it again from the admin, with
https://. - Apple shows "invalid_client": check the Services ID, the Team ID, the Key ID and that the
.p8key belongs to the same account. Check the domains under Domains and Subdomains too. - "Não foi possível entrar agora" (could not sign in now): the attempt expired (more than 10 minutes) or was opened in another browser. The customer tries again from the sign-in page.