> For the complete documentation index, see [llms.txt](https://docs.devolutions.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.devolutions.net/powershell-universal/fr/securite/enterprise-security/windows-sso.md).

# Authentification unique Windows

Activez l'authentification unique Windows dans PowerShell Universal à l'aide de Kerberos ou NTLM, en couvrant les configurations d'hébergement IIS et non IIS.

L'authentification Windows, aussi appelée authentification Negotiate, utilise Kerberos ou NTLM pour authentifier sans demander de mot de passe à l'utilisateur. Elle est principalement prise en charge dans les domaines Windows, mais elle peut être configurée sous Linux et Mac OS.

### appsettings.json

L'authentification Windows offre la prise en charge de l'authentification unique pour les navigateurs et les environnements qui la prennent en charge. Pour activer l'authentification Windows, réglez le paramètre `WindowsAuthentication` à true dans `appsettings.json`.

{% code collapsedlinecount="10" %}

```javascript
"Windows": {
  "Enabled": "true"
},
```

{% endcode %}

### Authentication.ps1

Vous pouvez activer l'authentification Windows en ajoutant un nouveau fournisseur d'authentification dans Secure > Authentication. Sélectionnez Windows et activez l'authentification.

Une fois Windows réglé à authenticated, l'authentification Windows peut maintenant être utilisée avec Universal. Vous devrez vous déconnecter afin d'utiliser l'authentification Windows.

### Authentification Windows dans IIS

Pour activer l'authentification Windows dans IIS, assurez-vous d'activer l'authentification Windows et de désactiver l'authentification anonyme.

Dans le fichier web.config inclus avec PowerShell Universal, assurez-vous d'avoir réglé `forwardWindowsAuthToken` à `true`.

{% code collapsedlinecount="10" %}

```
<aspNetCore processPath="Universal.Server.exe" arguments="" forwardWindowsAuthToken="true" stdoutLogEnabled="true" stdoutLogFile=".\logs\log" hostingModel="OutOfProcess"/>
```

{% endcode %}

### Authentification Windows en dehors d'IIS

L'authentification Windows est prise en charge en dehors d'IIS, mais elle nécessite la configuration du compte qui exécute le service Universal.

#### Windows

Sous Windows, vous devriez installer PowerShell Universal en tant que [service Windows](/powershell-universal/fr/getting-started.md#windows). Une fois le service installé, vous devrez créer un [utilisateur de compte de service](/powershell-universal/fr/config/running-as-a-service-account.md#application-service-account) et configurer le service pour qu'il s'exécute avec le compte de cet utilisateur. Le [paramètre ](/powershell-universal/fr/config/settings.md)d'authentification Windows doit être réglé à true.

{% code collapsedlinecount="10" %}

```javascript
"Windows": {
  "Enabled": "true"
},
```

{% endcode %}

Le compte de service doit avoir un nom de principal de service (spn) configuré pour le compte d'ordinateur. Vous pouvez le faire à l'aide de la commande `setspn`. Le nom de l'ordinateur doit être le nom complet qualifié de la machine qui exécute Universal.

{% code collapsedlinecount="10" %}

```
setspn -S HTTP/myservername.mydomain.com myuser
```

{% endcode %}

Pour plus d'information, vous pouvez suivre la documentation Microsoft sur la configuration de l'authentification Windows ASP.NET Core : [Configuring a Windows machine for Windows Authentication](https://docs.microsoft.com/en-us/aspnet/core/security/authentication/windowsauth?view=aspnetcore-3.1\&tabs=visual-studio#windows-environment-configuration)

#### Linux

[Configuring a Linux or Mac OS machine for Windows Authentication](https://docs.microsoft.com/en-us/aspnet/core/security/authentication/windowsauth?view=aspnetcore-3.1\&tabs=visual-studio#linux-and-macos-environment-configuration)

### Revendications mises en cache

PowerShell Universal met en cache les revendications d'appartenance à un groupe lorsque l'authentification Windows est utilisée. Les revendications sont mises en cache pendant la durée du délai d'expiration de session configuré (25 minutes par défaut).

Pour vider le cache manuellement, naviguez vers Secure > Roles et cliquez sur le bouton Clear Cached Claims.

## Configuration du navigateur

Selon votre environnement local, vous devrez peut-être configurer votre navigateur afin qu'il transmette correctement les identifiants à PowerShell Universal.

* [Google Chrome](https://chromeenterprise.google/policies/#HTTPAuthentication)
* [Microsoft Edge](https://learn.microsoft.com/en-us/deployedge/microsoft-edge-policies#http-authentication-policies)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.devolutions.net/powershell-universal/fr/securite/enterprise-security/windows-sso.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
