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

# Set-PSUAuthenticationMethod

Set-PSUAuthenticationMethod konfigurerer godkendelsesindstillinger i PowerShell Universal, herunder SAML2, OpenID Connect og andre udbydertyper.

## Synopsis

Konfigurerer en godkendelsesmetode.

## Syntaks

```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]`. Parametersættene ovenfor dækker henholdsvis generiske, SAML2-, OIDC-, WS-Federation-, logaf- og formularindstillinger. Angiv `-Type` til den ønskede udbyder; dens enum-navne omfatter `Form`, `Windows`, `Certificate`, `OpenIDConnect`, `WSFederation`, `Saml2`, `Basic` og `Devolutions`.

## Beskrivelse

Opretter en konfiguration af en godkendelsesmetode; kommandoen har også aliaset `New-PSUAuthenticationMethod`. Forms-indstillinger omfatter `-Native` og `-Domain`; udbyderspecifikke indstillinger konfigurerer OpenID Connect, SAML2 og WS-Federation. For OpenID Connect konfigurerer `-ClientCertificate` og `-ClientCertificatePassword` certifikatbaseret klientgodkendelse i stedet for eller sammen med en klienthemmelighed. Medtag ikke rigtige hemmeligheder i dokumentationseksempler.

## Eksempel

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

## Parametre

| Parameter                        | Beskrivelse                                                                                                                                        |
| -------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| `-Type`                          | Provider-enum: `Form`, `Windows`, `Certificate`, `OpenIDConnect`, `WSFederation`, `Saml2`, `Basic` eller `Devolutions`; standardværdien er `Form`. |
| `-ScriptBlock`                   | Godkendelsesscript, der er gemt sammen med metoden.                                                                                                |
| `-Disabled`                      | Deaktiverer metoden.                                                                                                                               |
| `-Configure`                     | Yderligere scriptblok til udbyderkonfiguration.                                                                                                    |
| `-CallbackPath`                  | Tilbagekalds-URL-sti; påkrævet for parametersættene SAML2, OIDC og WS-Federation.                                                                  |
| `-ClientId`                      | Klient-id for OpenID Connect (påkrævet for OIDC).                                                                                                  |
| `-ClientSecret`                  | OpenID Connect-klienthemmelighed.                                                                                                                  |
| `-ClientCertificate`             | Indstilling for OpenID Connect-klientcertifikat.                                                                                                   |
| `-ClientCertificatePassword`     | Adgangskode til OIDC-klientcertifikatet.                                                                                                           |
| `-Resource`                      | OIDC-ressourceidentifikator.                                                                                                                       |
| `-Authority`                     | OIDC-autoritets-URL.                                                                                                                               |
| `-ResponseType`                  | OIDC-svartype (som standard `code`).                                                                                                               |
| `-SaveTokens`                    | Om OIDC-tokens gemmes.                                                                                                                             |
| `-UseTokenLifetime`              | Om tokenlevetid skal bruges (OIDC eller WS-Federation).                                                                                            |
| `-RequireMfa`                    | Kræver MFA til OIDC.                                                                                                                               |
| `-GetClaimsFromUserInfoEndpoint` | Henter OIDC-claims fra brugeroplysningsslutpunktet.                                                                                                |
| `-Scopes`                        | OIDC-scopes (som standard `openid profile groups`).                                                                                                |
| `-CorrelationCookieSameSite`     | SameSite-indstilling for OIDC- eller WS-Federation-korrelationscookie.                                                                             |
| `-LogoutUrl`                     | Logaf-URL.                                                                                                                                         |
| `-Wtrealm`                       | WS-Federation-realm (påkrævet for WS-Federation).                                                                                                  |
| `-Wreply`                        | Svar-URL til WS-Federation (påkrævet for WS-Federation).                                                                                           |
| `-MetadataAddress`               | Udbyderens metadata-URL (påkrævet for WS-Federation; alias `-MetadataUrl`).                                                                        |
| `-SigningKey`                    | SAML2-signeringsnøgle.                                                                                                                             |
| `-EntityId`                      | Entity ID for SAML2-tjenesteudbyderen.                                                                                                             |
| `-IdentityProviderEntityId`      | Entity ID for SAML2-identitetsudbyderen.                                                                                                           |
| `-ServiceCertificate`            | SAML2-tjenestecertifikat.                                                                                                                          |
| `-SingleSignOnServiceUrl`        | URL til SAML2-logontjenesten.                                                                                                                      |
| `-AllowUnsolicitedAuthnResponse` | Tillader uopfordrede SAML2-godkendelsessvar.                                                                                                       |
| `-NameIdPolicy`                  | SAML2 name ID-politik: `undefined`, `persistent` eller `transient`.                                                                                |
| `-LoadMetadata`                  | Indlæser metadata for SAML2-udbyderen.                                                                                                             |
| `-Native`                        | Aktiverer nativ formulargodkendelse.                                                                                                               |
| `-Domain`                        | Domæne til formulargodkendelse.                                                                                                                    |
| `-ComputerName`                  | URL eller værtsnavn for PSU Management API (alias `-Uri`).                                                                                         |
| `-AppToken`                      | App-token til Management API.                                                                                                                      |
| `-Credential`                    | Legitimationsoplysninger til Management API.                                                                                                       |
| `-UseDefaultCredentials`         | Bruger de aktuelle Windows-legitimationsoplysninger.                                                                                               |
| `-Integrated`                    | Bruger den integrerede administrationsklient i processen.                                                                                          |
| `-TrustCertificate`              | Ignorerer fejl ved certifikatvalidering.                                                                                                           |
| `-Cookies`                       | Genbruger sessionscookies til godkendelse.                                                                                                         |

## Tilladelser

Adgangstokenet kræver `security.authentication/update` for at køre denne cmdlet eksternt.


---

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