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

# Set-PSUAuthenticationMethod

Set-PSUAuthenticationMethod configures authentication settings in PowerShell Universal, including SAML2, OpenID Connect, and other provider types.

## SYNOPSIS

Configures an authentication method.

## SYNTAX

```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]`. The parameter sets above respectively cover generic, SAML2, OIDC, WS-Federation, logout, and form options. Set `-Type` to the desired provider; its enum names include `Form`, `Windows`, `Certificate`, `OpenIDConnect`, `WSFederation`, `Saml2`, `Basic`, and `Devolutions`.

## DESCRIPTION

Creates an authentication-method configuration; the command is also aliased as `New-PSUAuthenticationMethod`. Forms options include `-Native` and `-Domain`; provider-specific options configure OpenID Connect, SAML2, and WS-Federation. For OpenID Connect, `-ClientCertificate` and `-ClientCertificatePassword` configure certificate-based client authentication in place of or alongside a client secret. Do not include real secrets in documentation examples.

## EXAMPLE

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

## PARAMETERS

| Parameter                        | Description                                                                                                                               |
| -------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| `-Type`                          | Provider enum: `Form`, `Windows`, `Certificate`, `OpenIDConnect`, `WSFederation`, `Saml2`, `Basic`, or `Devolutions`; defaults to `Form`. |
| `-ScriptBlock`                   | Authentication script stored with the method.                                                                                             |
| `-Disabled`                      | Disables the method.                                                                                                                      |
| `-Configure`                     | Additional provider configuration script block.                                                                                           |
| `-CallbackPath`                  | Callback URL path; required for SAML2, OIDC, and WS-Federation parameter sets.                                                            |
| `-ClientId`                      | OpenID Connect client ID (required for OIDC).                                                                                             |
| `-ClientSecret`                  | OpenID Connect client secret.                                                                                                             |
| `-ClientCertificate`             | OpenID Connect client certificate setting.                                                                                                |
| `-ClientCertificatePassword`     | Password for the OIDC client certificate.                                                                                                 |
| `-Resource`                      | OIDC resource identifier.                                                                                                                 |
| `-Authority`                     | OIDC authority URL.                                                                                                                       |
| `-ResponseType`                  | OIDC response type (defaults to `code`).                                                                                                  |
| `-SaveTokens`                    | Whether OIDC tokens are saved.                                                                                                            |
| `-UseTokenLifetime`              | Whether to use token lifetime (OIDC or WS-Federation).                                                                                    |
| `-RequireMfa`                    | Requires MFA for OIDC.                                                                                                                    |
| `-GetClaimsFromUserInfoEndpoint` | Retrieves OIDC claims from the user-info endpoint.                                                                                        |
| `-Scopes`                        | OIDC scopes (defaults to `openid profile groups`).                                                                                        |
| `-CorrelationCookieSameSite`     | SameSite setting for OIDC or WS-Federation correlation cookie.                                                                            |
| `-LogoutUrl`                     | Logout URL.                                                                                                                               |
| `-Wtrealm`                       | WS-Federation realm (required for WS-Federation).                                                                                         |
| `-Wreply`                        | WS-Federation reply URL (required for WS-Federation).                                                                                     |
| `-MetadataAddress`               | Provider metadata URL (required for WS-Federation; alias `-MetadataUrl`).                                                                 |
| `-SigningKey`                    | SAML2 signing key.                                                                                                                        |
| `-EntityId`                      | SAML2 service provider entity ID.                                                                                                         |
| `-IdentityProviderEntityId`      | SAML2 identity provider entity ID.                                                                                                        |
| `-ServiceCertificate`            | SAML2 service certificate.                                                                                                                |
| `-SingleSignOnServiceUrl`        | SAML2 sign-on service URL.                                                                                                                |
| `-AllowUnsolicitedAuthnResponse` | Allows unsolicited SAML2 authentication responses.                                                                                        |
| `-NameIdPolicy`                  | SAML2 name ID policy: `undefined`, `persistent`, or `transient`.                                                                          |
| `-LoadMetadata`                  | Loads SAML2 provider metadata.                                                                                                            |
| `-Native`                        | Enables native form authentication.                                                                                                       |
| `-Domain`                        | Domain for form authentication.                                                                                                           |
| `-ComputerName`                  | PSU Management API URL or host name (alias `-Uri`).                                                                                       |
| `-AppToken`                      | Management API app token.                                                                                                                 |
| `-Credential`                    | Management API credentials.                                                                                                               |
| `-UseDefaultCredentials`         | Uses current Windows credentials.                                                                                                         |
| `-Integrated`                    | Uses the in-process management client.                                                                                                    |
| `-TrustCertificate`              | Ignores certificate validation errors.                                                                                                    |
| `-Cookies`                       | Reuses session authentication cookies.                                                                                                    |

## PERMISSIONS

The access token requires `security.authentication/update` to run this cmdlet remotely.


---

# 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/powershell-commands/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.
