# Microsoft.AspNet.Identity.Core

**Kind:** Service

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

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

NuGet package dependency

`Microsoft.AspNet.Identity.Core` is a NuGet dependency referenced by `Pams.API`. It defines ASP.NET Identity types used by the API for user, claim, password, and authentication-related operations.

## Diagram

```mermaid
sequenceDiagram
    participant Client
    participant PamsAPI as Pams.API
    participant Identity as Microsoft.AspNet.Identity.Core

    Client->>PamsAPI: Send authenticated request
    PamsAPI->>Identity: Resolve user and claims
    Identity-->>PamsAPI: Return identity data
    PamsAPI-->>Client: Return API response
```

## Usage

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

if (!response.ok) {
  throw new Error("Profile request failed");
}

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

## AI Coding Instructions

- Treat `Microsoft.AspNet.Identity.Core` as a server-side dependency; do not import it into TypeScript or browser code.
- Keep identity and claim handling inside `Pams.API` authentication and authorization paths.
- Pass access tokens through the `Authorization` request header when calling protected API endpoints.
- Check the project dependency configuration before changing Identity types or authentication behavior, especially in the legacy project format.
