> 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/es/comandos-de-powershell/set-psuauthenticationmethod.md).

# Set-PSUAuthenticationMethod

Set-PSUAuthenticationMethod configura los ajustes de autenticación en PowerShell Universal, incluidos SAML2, OpenID Connect y otros tipos de proveedor.

## SINOPSIS

Configura un método de autenticación.

## SINTAXIS

```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]`. Los conjuntos de parámetros anteriores cubren respectivamente las opciones genéricas, de SAML2, de OIDC, de WS-Federation, de cierre de sesión y de formulario. Establezca `-Type` en el proveedor deseado; los nombres de su enumeración incluyen `Form`, `Windows`, `Certificate`, `OpenIDConnect`, `WSFederation`, `Saml2`, `Basic` y `Devolutions`.

## DESCRIPCIÓN

Crea una configuración de método de autenticación; el comando también tiene el alias `New-PSUAuthenticationMethod`. Las opciones de formulario incluyen `-Native` y `-Domain`; las opciones específicas del proveedor configuran OpenID Connect, SAML2 y WS-Federation. Para OpenID Connect, `-ClientCertificate` y `-ClientCertificatePassword` configuran la autenticación de cliente basada en certificado en lugar de un secreto de cliente o junto con él. No incluya secretos reales en los ejemplos de la documentación.

## EJEMPLO

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

## PARÁMETROS

| Parámetro                        | Descripción                                                                                                                                                        |
| -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `-Type`                          | Enumeración del proveedor: `Form`, `Windows`, `Certificate`, `OpenIDConnect`, `WSFederation`, `Saml2`, `Basic` o `Devolutions`; el valor predeterminado es `Form`. |
| `-ScriptBlock`                   | Script de autenticación almacenado con el método.                                                                                                                  |
| `-Disabled`                      | Deshabilita el método.                                                                                                                                             |
| `-Configure`                     | Bloque de script de configuración adicional del proveedor.                                                                                                         |
| `-CallbackPath`                  | Ruta de URL de devolución de llamada; obligatoria para los conjuntos de parámetros SAML2, OIDC y WS-Federation.                                                    |
| `-ClientId`                      | Id. de cliente de OpenID Connect (obligatorio para OIDC).                                                                                                          |
| `-ClientSecret`                  | Secreto de cliente de OpenID Connect.                                                                                                                              |
| `-ClientCertificate`             | Ajuste del certificado de cliente de OpenID Connect.                                                                                                               |
| `-ClientCertificatePassword`     | Contraseña del certificado de cliente de OIDC.                                                                                                                     |
| `-Resource`                      | Identificador de recurso de OIDC.                                                                                                                                  |
| `-Authority`                     | URL de autoridad de OIDC.                                                                                                                                          |
| `-ResponseType`                  | Tipo de respuesta de OIDC (de forma predeterminada, `code`).                                                                                                       |
| `-SaveTokens`                    | Indica si se guardan los tokens de OIDC.                                                                                                                           |
| `-UseTokenLifetime`              | Indica si se usa la duración del token (OIDC o WS-Federation).                                                                                                     |
| `-RequireMfa`                    | Requiere MFA para OIDC.                                                                                                                                            |
| `-GetClaimsFromUserInfoEndpoint` | Recupera las notificaciones de OIDC del punto de conexión de información del usuario.                                                                              |
| `-Scopes`                        | Ámbitos de OIDC (de forma predeterminada, `openid profile groups`).                                                                                                |
| `-CorrelationCookieSameSite`     | Ajuste SameSite de la cookie de correlación de OIDC o WS-Federation.                                                                                               |
| `-LogoutUrl`                     | URL de cierre de sesión.                                                                                                                                           |
| `-Wtrealm`                       | Dominio de WS-Federation (obligatorio para WS-Federation).                                                                                                         |
| `-Wreply`                        | URL de respuesta de WS-Federation (obligatoria para WS-Federation).                                                                                                |
| `-MetadataAddress`               | URL de metadatos del proveedor (obligatoria para WS-Federation; alias `-MetadataUrl`).                                                                             |
| `-SigningKey`                    | Clave de firma de SAML2.                                                                                                                                           |
| `-EntityId`                      | Id. de entidad del proveedor de servicios SAML2.                                                                                                                   |
| `-IdentityProviderEntityId`      | Id. de entidad del proveedor de identidades SAML2.                                                                                                                 |
| `-ServiceCertificate`            | Certificado de servicio de SAML2.                                                                                                                                  |
| `-SingleSignOnServiceUrl`        | URL del servicio de inicio de sesión de SAML2.                                                                                                                     |
| `-AllowUnsolicitedAuthnResponse` | Permite respuestas de autenticación SAML2 no solicitadas.                                                                                                          |
| `-NameIdPolicy`                  | Directiva de id. de nombre de SAML2: `undefined`, `persistent` o `transient`.                                                                                      |
| `-LoadMetadata`                  | Carga los metadatos del proveedor SAML2.                                                                                                                           |
| `-Native`                        | Habilita la autenticación de formulario nativa.                                                                                                                    |
| `-Domain`                        | Dominio para la autenticación de formulario.                                                                                                                       |
| `-ComputerName`                  | URL o nombre de host de la API de administración de PSU (alias `-Uri`).                                                                                            |
| `-AppToken`                      | Token de aplicación de la API de administración.                                                                                                                   |
| `-Credential`                    | Credenciales de la API de administración.                                                                                                                          |
| `-UseDefaultCredentials`         | Usa las credenciales actuales de Windows.                                                                                                                          |
| `-Integrated`                    | Usa el cliente de administración en proceso.                                                                                                                       |
| `-TrustCertificate`              | Ignora los errores de validación del certificado.                                                                                                                  |
| `-Cookies`                       | Reutiliza las cookies de autenticación de la sesión.                                                                                                               |

## PERMISOS

El token de acceso requiere `security.authentication/update` para ejecutar este cmdlet de forma remota.


---

# 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/es/comandos-de-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.
