> 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/it/sicurezza/enterprise-security/ws-federation.md).

# WS-Federation

Configurare l'autenticazione WS-Federation in PowerShell Universal con ADFS o Azure Active Directory, inclusa la configurazione della relying party trust.

{% hint style="info" %}
WS-Federation richiede una [licenza](https://store.devolutions.net/package#psu).
{% endhint %}

WS-Federation supporta sia Active Directory Federation Services sia Azure Active Directory.

Per prima cosa deve configurare ADFS o AzureAD per supportare Universal.

## Configurazione di ADFS per Universal <a href="#configuring-adfs-for-universal-dashboard" id="configuring-adfs-for-universal-dashboard"></a>

### Impostazioni del servizio <a href="#service-settings" id="service-settings"></a>

Per prima cosa, dovrà raccogliere le Federation Service Properties da ADFS. Apra l'app AD FS (Microsoft.IdentityServer.msc). Quindi faccia clic su Service e poi su Edit Federation Service Properties.

Si aprirà una finestra di dialogo con i valori del suo servizio ADFS. Avrà bisogno di questi valori per configurare PowerShell Universal.

### Relying party <a href="#relying-parties" id="relying-parties"></a>

Se non ha configurato alcuna Relying Party Trust, faccia clic su Add Replying Party Trust. Selezioni Claims aware.

Selezioni Enter data about the relying party manually.

Specifichi un nome per la relying party.

Abiliti il protocollo WS-Federation Passive. Inserisca l'URL del server PowerShell Universal con una barra finale.

Inserisca l'URL del suo server PowerShell Universal.

Dopo aver completato la configurazione della Replying Party Trust, dovrà impostare una Claim Issuance Policy. Crei una Issuance Transform Rule che invii almeno il Name e il Name ID a Universal.

Può configurare ulteriori claim che desidera utilizzare se sta usando le policy in Universal.

### Risoluzione dei problemi

MSIS7065: There are no registered protocol handlers on path /adfs/ls to process the incoming request.

Questo problema può verificarsi se la pagina IDP Initiated Sign On è disabilitata. Questa è l'impostazione predefinita. Esegua il comando seguente da una console amministrativa.

{% code collapsedlinecount="10" %}

```powershell
 Set-AdfsProperties -EnableIdPInitiatedSignonPage $true
```

{% endcode %}

MSIS7001: The passive protocol context was not found or not valid. If the context was stored in cookies, the cookies that were presented by the client were not valid. Ensure that the client browser is configured to accept cookies from this website and retry this request.

## Configurazione per Azure Active Directory <a href="#configuring-for-azure-active-directory" id="configuring-for-azure-active-directory"></a>

Segua la documentazione per la configurazione di Azure Active Directory disponibile in questo [documento Microsoft](https://docs.microsoft.com/en-us/aspnet/core/security/authentication/ws-federation?view=aspnetcore-2.2#azure-active-directory).

## Configurazione di Universal <a href="#configuring-universal-dashboard" id="configuring-universal-dashboard"></a>

### Usare Appsettings.json

Dopo aver configurato ADFS o AAD, può ora fornire a Universal le proprietà per MetadataAddress e Wtrealm. Legga informazioni su queste impostazioni nella nostra [pagina Impostazioni](/powershell-universal/it/config/settings.md).

Ecco un esempio di come aggiornare il file `appsettings.json` per adattarlo alle impostazioni corrette per WS-Federation.

{% code collapsedlinecount="10" %}

```javascript
{
  "Kestrel": {
    "Endpoints": {
      "HTTP": {
        "Url": "http://*:5000"
      }
    },
    "RedirectToHttps": "false"
  },
  "ApplicationInsights": {
    "InstrumentationKey": ""
  },
  "Logging": {
    "Path": "%PROGRAMDATA%/PowerShellUniversal/log.txt",
    "RetainedFileCountLimit": 31,
    "LogLevel": {
      "Default": "Information",
      "Microsoft": "Warning",
      "Microsoft.Hosting.Lifetime": "Information"
    }
  },
  "AllowedHosts": "*",
  "CorsHosts": "",
  "Data": {
    "RepositoryPath": "%ProgramData%\\UniversalAutomation\\Repository",
    "ConnectionString": "%ProgramData%\\UniversalAutomation\\database.db",
    "GitRemote": "",
    "GitUserName": "",
    "GitPassword": "", 
    "ConfigurationScript": ""
  },
  "Api": {
    "Url": ""
  },
  "Authentication" : {
    "Windows": {
      "Enabled": "false"
    },
    "WSFed": {
        "Enabled": "true",
        "MetadataAddress": "https://ironman.local:443/FederationMetadata/2007-06/FederationMetadata.xml",
        "Wtrealm": "https://ironman.local:12345",
        "CallbackPath": "/auth/signin-wsfed"
    },
    "OIDC": {
      "Enabled": "false",
      "CallbackPath": "/auth/signin-oidc",
      "ClientID": "",
      "ClientSecret": "",
      "Resource": "",
      "Authority": "",
      "ResponseType": "",
      "SaveTokens": "false"
    },
    "SessionTimeout": "25"
  },
  "Jwt": {  
    "SigningKey": "PleaseUseYourOwnSigningKeyHere",  
    "Issuer": "IronmanSoftware",
    "Audience": "PowerShellUniversal"
  },
  "UniversalDashboard": {
    "AssetsFolder": "%ProgramData%\\PowerShellUniversal\\Dashboard"
  },
  "ShowDevTools": false,
  "HideAdminConsole": false
}
```

{% endcode %}

Quando esegue il server, ora le dovrebbero essere richieste le credenziali tramite il sistema di single sign-on di Internet Explorer oppure verrà reindirizzato alla pagina di accesso WS-Fed.

### Usare Authentication.ps1

Può configurare l'autenticazione WS-Federation nella console di amministrazione. Per farlo, vada su Secure > Authentication. Aggiunga il provider WS-Federation selezionandolo dal menu a discesa in alto a destra.

Successivamente, modifichi le proprietà del provider di autenticazione e specifichi i dettagli di configurazione per la sua installazione ADFS.

Una volta configurato, abiliti il provider WS-Federation. Quindi si disconnetta e vada su `/admin` Le verrà richiesto di accedere al suo provider WS-Federation.


---

# 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 dynamically by asking a question.

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

```
GET https://docs.devolutions.net/powershell-universal/it/sicurezza/enterprise-security/ws-federation.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
