> 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/sikkerhed/enterprise-security/openid-connect/client-certificate-authentication.md).

# Godkendelse med klientcertifikat

Godkend OpenID Connect-klienter i PowerShell Universal med et RSA-certifikat ved hjælp af en private\_key\_jwt-assertion i stedet for en klienthemmelighed.

OpenID Connect-klienter (OIDC) kan godkende sig over for en udbyder med et RSA-certifikat i stedet for en klienthemmelighed. PowerShell Universal opretter en kortlivet `private_key_jwt`-assertion ved hjælp af PS256, når den indløser autorisationskoden.

## Krav

* Identitetsudbyderen skal understøtte `private_key_jwt`-klientgodkendelse.
* Certifikatfilen skal være en PFX, der indeholder en privat RSA-nøgle.
* Klientregistreringen hos identitetsudbyderen skal konfigureres til det certifikat, der bruges af PowerShell Universal.

## Konfigurer OIDC

I OIDC-godkendelseseditoren under **Secure > Authentication** skal De angive certifikatstien. Angiv eventuelt dens adgangskode. Hvis adgangskodeværdien er navnet på en PSU-hemmelighedsvariabel, opløser PowerShell Universal den hemmelighed på kørselstidspunktet.

Det eksisterende OIDC-flow med klienthemmelighed er uændret. Konfigurer enten en klienthemmelighed eller et klientcertifikat til den klientgodkendelsesmetode, der er påkrævet af Deres udbyder.

Brug `Set-PSUAuthenticationMethod` til at konfigurere de samme indstillinger fra PowerShell:

```powershell
Set-PSUAuthenticationMethod -Type OIDC `
    -CallbackPath '/auth/signin-oidc' `
    -ClientId '00000000-0000-0000-0000-000000000000' `
    -Authority 'https://login.microsoftonline.com/contoso.onmicrosoft.com/v2.0' `
    -ClientCertificate 'C:\certificates\psu-oidc.pfx' `
    -ClientCertificatePassword 'PsuOidcCertificatePassword'
```

Hold certifikatfilen læsbar for den konto, der kører PowerShell Universal. Gem ikke en certifikatadgangskode i klartekst, når en PSU-hemmelighedsvariabel er tilgængelig.


---

# 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/sikkerhed/enterprise-security/openid-connect/client-certificate-authentication.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.
