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¶
GetUser(userId)callsGetUser<UserProfile>(userId).- Replace
\\with/inuserId(BR-AUTH-009), thenGET /v1/Users/GetUser/{userId}throughHandleSecurityServiceGetResponse<T>(BR-AUTH-011) - 2.1 Await the GET call.
- 2.2 On success, return
result.GetResult<T>(). - 2.3 Otherwise, if
result.ErrorExceptionis present, throwSecurityClientException(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 (
SAIF.NetCore.AuthService) and executed on behalf of this operation.
Process flow¶
The following diagram visualizes this operation's control flow.
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¶
Sources¶
src/SAIF.NetCore.AuthService/SAIF.NetCore.AuthService/SAIF.NetCore.AuthService/Clients/SecurityClient.cs