# IdentityServer3

**Kind:** Service

**Source:** `Pams/API/Pams.API/Pams.API.csproj` (line 1)

**Part of:** [Pams](subsystem-pams)

NuGet package dependency

IdentityServer3 is a NuGet package dependency declared in `Pams.API.csproj` for identity and token endpoint support. Pams.API integrates with IdentityServer3 to authenticate clients and process access tokens for protected API requests.

## Diagram

```mermaid
graph TD
    Client[Client Application] -->|Authentication request| IdentityServer3[IdentityServer3]
    IdentityServer3 -->|Access token| Client
    Client -->|Bearer token| PamsAPI[Pams.API]
    PamsAPI -->|Validate token| IdentityServer3
```

## Usage

```ts
const identityServerUrl = process.env.IDENTITY_SERVER_URL;
const clientId = process.env.IDENTITY_CLIENT_ID;
const redirectUri = `${window.location.origin}/auth/callback`;

const authorizationUrl = new URL("/connect/authorize", identityServerUrl);

authorizationUrl.search = new URLSearchParams({
  client_id: clientId,
  redirect_uri: redirectUri,
  response_type: "code",
  scope: "openid profile"
}).toString();

window.location.assign(authorizationUrl.toString());
```

## AI Coding Instructions

- Keep IdentityServer3 configuration aligned with the identity endpoint and client settings used by Pams.API.
- Do not store client secrets or access tokens in browser source code.
- Send access tokens to protected Pams.API endpoints through the `Authorization: Bearer <token>` header.
- Treat IdentityServer3 as a legacy package dependency when changing authentication-related NuGet references.

## Used by

1 reference from 1 file. Each is a place in this repository where the symbol is actually used — go read one rather than trusting an example.

### Injected or called by (1)

- `Pams.API` — `Pams/API/Pams.API/Pams.API.csproj`:1
