> 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/comandi-powershell/set-psuauthenticationmethod.md).

# Set-PSUAuthenticationMethod

Set-PSUAuthenticationMethod configura le impostazioni di autenticazione in PowerShell Universal, inclusi SAML2, OpenID Connect e altri tipi di provider.

## SINOSSI

Configura un metodo di autenticazione.

## SINTASSI

```powershell
Set-PSUAuthenticationMethod [-Type <AuthenticationMethodType>] [-ScriptBlock <ScriptBlock>] [-Disabled] [-Configure <ScriptBlock>] [<ConnectionOptions>] [<CommonParameters>]
Set-PSUAuthenticationMethod -CallbackPath <String> [-MetadataAddress <String>] [-SigningKey <String>] [-EntityId <String>] [-IdentityProviderEntityId <String>] [-ServiceCertificate <String>] [-SingleSignOnServiceUrl <String>] [-AllowUnsolicitedAuthnResponse] [-NameIdPolicy <String>] [-LoadMetadata] [<CommonOptions>]
Set-PSUAuthenticationMethod -CallbackPath <String> -ClientId <String> [-ClientSecret <String>] [-ClientCertificate <String>] [-ClientCertificatePassword <String>] [-Resource <String>] [-Authority <String>] [-ResponseType <String>] [-SaveTokens <Boolean>] [-UseTokenLifetime <Boolean>] [-RequireMfa] [-GetClaimsFromUserInfoEndpoint <Boolean>] [-Scopes <String>] [-CorrelationCookieSameSite <String>] [<CommonOptions>]
Set-PSUAuthenticationMethod -CallbackPath <String> -Wtrealm <String> -Wreply <String> -MetadataAddress <String> [-UseTokenLifetime <Boolean>] [-CorrelationCookieSameSite <String>] [<CommonOptions>]
Set-PSUAuthenticationMethod [-LogoutUrl <String>] [<CommonOptions>]
Set-PSUAuthenticationMethod [-Native] [-Domain <String>] [<CommonOptions>]
```

`<CommonOptions>`: `[-Type <AuthenticationMethodType>] [-ScriptBlock <ScriptBlock>] [-Disabled] [-Configure <ScriptBlock>] [<ConnectionOptions>] [<CommonParameters>]`. `<ConnectionOptions>`: `[-ComputerName <String>] [-AppToken <String>] [-Credential <PSCredential>] [-UseDefaultCredentials] [-Integrated] [-TrustCertificate] [-Cookies]`. I set di parametri sopra riguardano rispettivamente le opzioni generiche, SAML2, OIDC, WS-Federation, di disconnessione e di modulo. Imposti `-Type` sul provider desiderato; i nomi della sua enumerazione includono `Form`, `Windows`, `Certificate`, `OpenIDConnect`, `WSFederation`, `Saml2`, `Basic` e `Devolutions`.

## DESCRIZIONE

Crea una configurazione di metodo di autenticazione; il comando ha anche l'alias `New-PSUAuthenticationMethod`. Le opzioni del modulo includono `-Native` e `-Domain`; le opzioni specifiche del provider configurano OpenID Connect, SAML2 e WS-Federation. Per OpenID Connect, `-ClientCertificate` e `-ClientCertificatePassword` configurano l'autenticazione client basata su certificato al posto di un segreto client o insieme a esso. Non includa segreti reali negli esempi della documentazione.

## ESEMPIO

```powershell
Set-PSUAuthenticationMethod -Type OpenIDConnect -CallbackPath '/signin-oidc' -ClientId 'psu' -Authority 'https://identity.example.com' -ClientCertificate 'C:\certs\psu.pfx' -ClientCertificatePassword $env:PSU_OIDC_CERT_PASSWORD
```

## PARAMETRI

| Parametro                        | Descrizione                                                                                                                                                     |
| -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `-Type`                          | Enumerazione del provider: `Form`, `Windows`, `Certificate`, `OpenIDConnect`, `WSFederation`, `Saml2`, `Basic` o `Devolutions`; il valore predefinito è `Form`. |
| `-ScriptBlock`                   | Script di autenticazione archiviato con il metodo.                                                                                                              |
| `-Disabled`                      | Disabilita il metodo.                                                                                                                                           |
| `-Configure`                     | Blocco di script di configurazione aggiuntiva del provider.                                                                                                     |
| `-CallbackPath`                  | Percorso URL di callback; obbligatorio per i set di parametri SAML2, OIDC e WS-Federation.                                                                      |
| `-ClientId`                      | ID client di OpenID Connect (obbligatorio per OIDC).                                                                                                            |
| `-ClientSecret`                  | Segreto client di OpenID Connect.                                                                                                                               |
| `-ClientCertificate`             | Impostazione del certificato client di OpenID Connect.                                                                                                          |
| `-ClientCertificatePassword`     | Password del certificato client OIDC.                                                                                                                           |
| `-Resource`                      | Identificatore della risorsa OIDC.                                                                                                                              |
| `-Authority`                     | URL dell'autorità OIDC.                                                                                                                                         |
| `-ResponseType`                  | Tipo di risposta OIDC (per impostazione predefinita, `code`).                                                                                                   |
| `-SaveTokens`                    | Indica se i token OIDC vengono salvati.                                                                                                                         |
| `-UseTokenLifetime`              | Indica se usare la durata del token (OIDC o WS-Federation).                                                                                                     |
| `-RequireMfa`                    | Richiede MFA per OIDC.                                                                                                                                          |
| `-GetClaimsFromUserInfoEndpoint` | Recupera le attestazioni OIDC dall'endpoint delle informazioni utente.                                                                                          |
| `-Scopes`                        | Ambiti OIDC (per impostazione predefinita, `openid profile groups`).                                                                                            |
| `-CorrelationCookieSameSite`     | Impostazione SameSite del cookie di correlazione OIDC o WS-Federation.                                                                                          |
| `-LogoutUrl`                     | URL di disconnessione.                                                                                                                                          |
| `-Wtrealm`                       | Ambito WS-Federation (obbligatorio per WS-Federation).                                                                                                          |
| `-Wreply`                        | URL di risposta WS-Federation (obbligatorio per WS-Federation).                                                                                                 |
| `-MetadataAddress`               | URL dei metadati del provider (obbligatorio per WS-Federation; alias `-MetadataUrl`).                                                                           |
| `-SigningKey`                    | Chiave di firma SAML2.                                                                                                                                          |
| `-EntityId`                      | ID entità del provider di servizi SAML2.                                                                                                                        |
| `-IdentityProviderEntityId`      | ID entità del provider di identità SAML2.                                                                                                                       |
| `-ServiceCertificate`            | Certificato del servizio SAML2.                                                                                                                                 |
| `-SingleSignOnServiceUrl`        | URL del servizio di accesso SAML2.                                                                                                                              |
| `-AllowUnsolicitedAuthnResponse` | Consente risposte di autenticazione SAML2 non sollecitate.                                                                                                      |
| `-NameIdPolicy`                  | Criterio dell'ID nome SAML2: `undefined`, `persistent` o `transient`.                                                                                           |
| `-LoadMetadata`                  | Carica i metadati del provider SAML2.                                                                                                                           |
| `-Native`                        | Abilita l'autenticazione nativa tramite modulo.                                                                                                                 |
| `-Domain`                        | Dominio per l'autenticazione tramite modulo.                                                                                                                    |
| `-ComputerName`                  | URL o nome host dell'API di gestione PSU (alias `-Uri`).                                                                                                        |
| `-AppToken`                      | Token dell'app dell'API di gestione.                                                                                                                            |
| `-Credential`                    | Credenziali dell'API di gestione.                                                                                                                               |
| `-UseDefaultCredentials`         | Usa le credenziali Windows correnti.                                                                                                                            |
| `-Integrated`                    | Usa il client di gestione nel processo.                                                                                                                         |
| `-TrustCertificate`              | Ignora gli errori di convalida del certificato.                                                                                                                 |
| `-Cookies`                       | Riutilizza i cookie di autenticazione della sessione.                                                                                                           |

## AUTORIZZAZIONI

Il token di accesso richiede `security.authentication/update` per eseguire questo cmdlet in remoto.


---

# 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/it/comandi-powershell/set-psuauthenticationmethod.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.
