> 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

{% 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.

Deve prima 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.

<figure><img src="/files/88BZZcPYp1xzMqBpvZki" alt=""><figcaption></figcaption></figure>

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

![](https://gblobscdn.gitbook.com/assets%2F-L9mVQO4zbOX7ZcHvIte%2F-Lob6ow15SQRLl3vo8ZV%2F-Lob7luBvuEGUTrLIors%2Fimage.png?alt=media\&token=64c3c00f-1d2c-4346-bcc1-dd89e7cf4c24)

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

Se non ha configurato alcun Reply Party Trusts, faccia clic su Add Replying Party Trust. Selezioni Claims aware.

<figure><img src="/files/FJfZvDfVTgYPaQaFmu4C" alt=""><figcaption><p>Claims Aware</p></figcaption></figure>

Selezioni Enter data about the relying party manually.

<figure><img src="/files/7iIj5SsydDACUV4Hseya" alt=""><figcaption><p>Manual Relying Party</p></figcaption></figure>

Specifichi un nome per la relying party.

<figure><img src="/files/I8CH4azwgBf7urTTN8u7" alt=""><figcaption><p>Relying Party Name</p></figcaption></figure>

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

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

Inserisca l'URL del suo server PowerShell Universal.

<figure><img src="/files/joOTW23pKB4XKVyiJJ1d" alt=""><figcaption><p>Replying Party Trust Identifier</p></figcaption></figure>

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

<figure><img src="https://gblobscdn.gitbook.com/assets%2F-L9mVQO4zbOX7ZcHvIte%2F-Lob6ow15SQRLl3vo8ZV%2F-Lob92zcF4qYpWtR0g_4%2Fimage.png?alt=media&#x26;token=34dfd4db-d742-4f8b-a271-86d37542dc35" alt=""><figcaption></figcaption></figure>

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.

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

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 applicare le impostazioni corrette per WS-Federation.

```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
}
```

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.

![](https://gblobscdn.gitbook.com/assets%2F-L9mVQO4zbOX7ZcHvIte%2F-Lob6ow15SQRLl3vo8ZV%2F-Lob9yeDdGENbUiyz4Sj%2Fimage.png?alt=media\&token=910db2dd-85f3-46eb-b3ec-9f551f244439)

### Usare Authentication.ps1

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

![](/files/f1kCh18el8x9Wjmu0zkY)

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

![](/files/7CQfYUSXCdkaONO7fVYG)

Una volta configurato, abiliti il provider WS-Federation. Quindi, effettui il logout e navighi 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.
