# Azure (oAuth2)

### Create an Azure account and configure credentials

For using Microsoft Entry ID (Azure), you need a Microsoft and a Azure account. If you allready have them, please continue with step 3.

1. Register your Microsoft account at <https://signup.live.com>
2. Go to <https://azure.microsoft.com/de-de/free>. If you don't need premium features, you can register for the free account.
3. Login into [portal.azure.com](https://portal.azure.com/).
4. Search for **App registrations**.
5. Click on **New registration** or choose your existing registration.\
   ![](/files/JGktPyVpTSCGLM6xbrWC)
6. Enter a **name**, that identifies your new app registration. At **Supported account types** you can define, which users should have access with their Azure login in your shop. \
   Enter the **Redirect URI** from your configured Azure service in Shopware. If you haven't configured it yet you can follow our guide at [Configure Azure in Shopware extension](#configure-azure-in-shopware-extension).\
   ![](/files/EqbsgWLpu1QXd0Dy8KeF)
7. Click **Register** to create your new app registration.
8. Copy the **Application (client) ID** and the **Directory (tenant) ID** and enter them to your **Azure credential config** in Shopware.\
   ![](/files/M9jDriDmiC1eV8SQWUv7)
9. Click on Client credentials to generate the **Client secrect**, that you also need to enter in **Azure credential config** in Shopware.\
   Please note: Use the **Value** and not the **Secret ID** of your newly created secret.

### Configure Azure 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 Azure implementation.

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

You can find the required credentials (**clientId**, **providerUri**,  **clientSecret** and **tenantId**) in your created app integration of the Azure 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 Azure.
{% endhint %}

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

{% hint style="info" %}
If some fields like address data is not filled, then Azure only returns e-mail address and name. 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 %}

### Add/ edit user in Azure directory

To enable your Aure directory users to sign in at Shopware storefront, you need to add them to your directory.

1. Login into <https://portal.azure.com/>
2. Search for **Microsoft Entra ID**.
3. Click **Manage -> Users**.
4. You will find a list of all existing users. You can edit a user or click on **New user** to create a new one.\
   ![](/files/mz7VFa7BH6sguuseOFvM)
5. Please ensure, that your new user will have an e-mail address, a firstname and a lastname. This fields are required in Shopware. You don't need to fill the address fields, because they will not transfered to Shopware.


---

# 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/azure-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.
