---
title: Get user profile
summary: Retrieves the SecurityApi's user-profile record for the given user ID.
status: draft
owner: Framework.NCore maintainers
last_reviewed: 2026-10-02
library: SAIF.NetCore.AuthService
reference_type: package
operation_id: OP-05
trigger: Caller code requests a user's profile data.
---

# Get user profile

Retrieves the SecurityApi's user-profile record for the given user ID.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-05 |
| **Trigger** | Caller code requests a user's profile data. |
| **Inputs** | `userId`. |
| **Outputs** | `UserProfile` (or a caller-supplied `T`), or a thrown `SecurityClientException`. |
| **Primary components** | `SecurityClient.GetUser(userId)` / `GetUser<T>(userId)` |
| **Entry point** | `src/SAIF.NetCore.AuthService/SAIF.NetCore.AuthService/SAIF.NetCore.AuthService/Clients/SecurityClient.cs` |

## Steps

1. `GetUser(userId)` calls `GetUser<UserProfile>(userId)`.
2. Replace `\\` with `/` in `userId` ([BR-AUTH-009](../business-rules.md#br-auth-009-backslashes-in-user-ids-are-rewritten-to-forward-slashes)), then `GET /v1/Users/GetUser/{userId}` through `HandleSecurityServiceGetResponse<T>` ([BR-AUTH-011](../business-rules.md#br-auth-011-a-non-successful-securityapi-response-always-throws))
   - 2.1 Await the GET call.
   - 2.2 On success, return `result.GetResult<T>()`.
   - 2.3 Otherwise, if `result.ErrorException` is present, throw `SecurityClientException(result.ErrorMessage, result.ErrorException)` (error with inner exception).
   - 2.4 Otherwise (no inner exception), throw `SecurityClientException(result.ErrorMessage)`.

   > **Origin**: Steps 2.1–2.4 are implemented in [Handle a Security API response](handle-a-security-api-response.md) (`SAIF.NetCore.AuthService`) and executed on behalf of this operation.

## Process flow

The following diagram visualizes this operation's control flow.

```mermaid
flowchart TD
    Start([GetUser called]) --> Replace["userId: \\ -> /"]
    Replace --> Get["GET /v1/Users/GetUser/userId"]
    Get --> Success{IsSuccessful?}
    Success -->|Yes| Return([Return T]) 
    Success -->|No| Throw([Throw SecurityClientException])
```

## Failure and edge-case behavior

- A non-success remote response throws `SecurityClientException`.

## Related documentation
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)

## Sources
- `src/SAIF.NetCore.AuthService/SAIF.NetCore.AuthService/SAIF.NetCore.AuthService/Clients/SecurityClient.cs`
