# Patron Authentication

Provider API v0.6.5 · 4 operationer
Kilde: https://plas.redia.dk/provider/v0.6.5/patron-authentication/

Ingen beskrivelse i specifikationen.

## Authenticate patron

`POST` `/patron/authentication` · `AuthenticatePatron`

Authenticate patron by credentials.

### Parametre

Fælles for operationerne: `version`. [Se den fælles kontrakt på versionssiden.](https://plas.redia.dk/provider/v0.6.5/)

### Request body

`application/json` · påkrævet

Authentication Patron

[`PatronAuthenticationRequestBody`](https://plas.redia.dk/provider/v0.6.5/schemas/#PatronAuthenticationRequestBody)

### Svar

- `200` [`PatronAuthenticationResponseBody`](https://plas.redia.dk/provider/v0.6.5/schemas/#PatronAuthenticationResponseBody) — Success

Fejlsvar: 400 · 401 — [Se den fælles kontrakt på versionssiden.](https://plas.redia.dk/provider/v0.6.5/)

## Authenticate patron by code and code verifier from SSO login.

`POST` `/patron/authentication/authenticate-token` · `AuthenticatePatronByCodeAndCodeVerifier`

### Parametre

Fælles for operationerne: `version`. [Se den fælles kontrakt på versionssiden.](https://plas.redia.dk/provider/v0.6.5/)

### Request body

`application/x-www-form-urlencoded` · påkrævet

- `code` (`string`, påkrævet) — The code obtained from a SSO patron authentication.
- `code_verifier` (`string`, påkrævet) — The code verifier use to create the code challenge use to obtained the code.
- `identity_provider` ([`ConfigurationPatronIdentityProviderType`](https://plas.redia.dk/provider/v0.6.5/schemas/#ConfigurationPatronIdentityProviderType), påkrævet)

### Svar

- `200` [`PatronAuthenticationByCodeAndCodeVerifierResponseBody`](https://plas.redia.dk/provider/v0.6.5/schemas/#PatronAuthenticationByCodeAndCodeVerifierResponseBody) — Success

Fejlsvar: 400 · 401 — [Se den fælles kontrakt på versionssiden.](https://plas.redia.dk/provider/v0.6.5/)

## This will fetch a SSO URL used for patron login, matching the chosen identity provider.

`POST` `/patron/authentication/identity-provider` · `GetPatronAuthenticationUrlByIdentityProvider`

### Parametre

- `identity_provider` (i `query`, [`ConfigurationPatronIdentityProviderType`](https://plas.redia.dk/provider/v0.6.5/schemas/#ConfigurationPatronIdentityProviderType), påkrævet) — The identity provider type, found in GET /configuration.
- `code_challenge` (i `query`, `string`, påkrævet) — A hashed value (of the code_verifier from a PKCE flow) used to secure the authorization code exchange.
- `state` (i `query`, `string`, påkrævet) — A random string to protect against CSRF and track the request state. The value should be returned to the Vendor on the callback url after login.
- `prompt` (i `query`, `string enum`, valgfri) — If prompt is set to login, the returned url should force a new login, even if the user is already logged in.
- `app_redirect_url` (i `query`, `string (uri)`, valgfri) — This value should be returned to the Vendor on the callback url after login.

Fælles for operationerne: `version`. [Se den fælles kontrakt på versionssiden.](https://plas.redia.dk/provider/v0.6.5/)

### Svar

- `200` [`PatronAuthenticationIdentityProviderResponseBody`](https://plas.redia.dk/provider/v0.6.5/schemas/#PatronAuthenticationIdentityProviderResponseBody) — Success

Fejlsvar: 400 · 401 — [Se den fælles kontrakt på versionssiden.](https://plas.redia.dk/provider/v0.6.5/)

## Authenticate patron without use of a password

`POST` `/patron/authentication/no-password` · `AuthenticatePatronNoPassword`

Authenticate patron without use of a password. This should only be used when absolutely necessary.

### Parametre

Fælles for operationerne: `version`. [Se den fælles kontrakt på versionssiden.](https://plas.redia.dk/provider/v0.6.5/)

### Request body

`application/json` · påkrævet

Authentication Patron without using password

[`PatronAuthenticationNoPasswordRequestBody`](https://plas.redia.dk/provider/v0.6.5/schemas/#PatronAuthenticationNoPasswordRequestBody)

### Svar

- `200` [`PatronAuthenticationNoPasswordResponseBody`](https://plas.redia.dk/provider/v0.6.5/schemas/#PatronAuthenticationNoPasswordResponseBody) — Success

Fejlsvar: 400 · 401 — [Se den fælles kontrakt på versionssiden.](https://plas.redia.dk/provider/v0.6.5/)
