# Microsoft.IdentityModel.Extensions

**Kind:** Service

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

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

NuGet package dependency

`Microsoft.IdentityModel.Extensions` is a NuGet dependency declared by the Pams API project. It provides shared identity-model support used by .NET authentication and token-processing components. The API uses it indirectly through its authentication configuration and related Microsoft identity packages.

## Diagram

```mermaid
flowchart LR
    Client[Client Application] -->|Bearer token| Api[Pams API]
    Api --> Auth[ASP.NET authentication]
    Auth --> Extensions[Microsoft.IdentityModel.Extensions]
    Extensions --> Result[Authentication result]
```

## Usage

```typescript
const response = await fetch("/api/pams/requests", {
  headers: {
    Authorization: `Bearer ${accessToken}`,
    Accept: "application/json",
  },
});

if (!response.ok) {
  throw new Error("Request was not authorized or failed.");
}

const requests = await response.json();
console.log(requests);
```

## AI Coding Instructions

- Treat `Microsoft.IdentityModel.Extensions` as a project dependency; application code should use the configured ASP.NET authentication pipeline rather than calling package internals directly.
- Keep bearer-token handling at API boundaries through standard `Authorization` headers.
- Check related `Microsoft.IdentityModel.*` package versions when changing this dependency to avoid incompatible identity assemblies.
- Do not expose token validation details or authentication errors directly in API responses.

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