# Google Sign-In (oAuth2)

### Steps to set up Google Sing-In

For using Google Sign-In, you need a Google account. If you allready have them, please continue with step 2.

1. Open Google Cloud Console <https://console.cloud.google.com/> and register a new account or login with your existing one.
2. **Create or select a Project**
   * Click on **Select Project → New Project**
   * Give your project a name (e.g., *Shopware SSO*)
3. Configure OAuth Consent Screen
   * Go to **APIs & Services → OAuth consent screen**.
   * Click on **Get started**.
   * Choose an app name and enter a support e-mail address, then click **Next**.
   * Choose External (if users outside your Google Workspace need to log in) or Internal, then click **Next**.
   * Enter a contact e-mail address and click **Next**.
   * Agree the Google terms and click **Continue**.
   * Click the **Create** button.
4. Create OAuth 2.0 Credentials
   * Navigate to **APIs & Services → Credentials → Create Credentials → OAuth client ID**.
   * Choose **Web application**.
   * Add **Authorized redirect URIs** from your configured **Google Sign-In** service in Shopware. If you haven't configured it yet you can follow our guide at [Configure Google Sign-In in Shopware extension](#configure-google-singn-in-in-shopware-extension).
5. Copy your Client ID and Client Secret
   * You’ll need them for Shopware configuration.

### Configure Google Sing-in in Shopware extension

For detailed information follow the guide for managing the [SSO providers](/en/plugins/single-sign-on-sso/admin-dashboard/mapping.md).\
See screenshot to be aware of the required fields for Google Sign-in implementation.

<figure><img src="/files/GY0Cc0dhoxSS5jOfRk6Z" alt=""><figcaption></figcaption></figure>

You can find the required credentials (**clientId** and **clientSecret**) in your created app integration of the Google account.

{% hint style="info" %}
Don't forget to use the **Check credentials** button after you've entered and saved all credentials. With this button you can check if your connection could be established with Google.
{% endhint %}

If you use the Google Sign-In template, all required mapping fields are already pre-configured.

{% hint style="info" %}
Google only returns the e-mail address and name of a user. So don't forgett to add the other fields in Shopware SSO mapping configuration with a default value. Otherwise there will be an exception on first login, because the fields **street**, **zip**, **city** and **country** are required fields in Shopware.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.premsoft.de/en/plugins/single-sign-on-sso/configuring-an-identity-provider/google-sign-in-oauth2.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
