Skip to content

OP-017: Resolve a user across Active Directory, WCIS, ADP, and external-user sources in priority order

GetUser is invoked over the Security route on SAIF.Services.WCF.Services.Security.SecurityService; this page documents the process end to end, from route dispatch to the message the caller receives.

Field Value
Operation ID OP-017
Trigger Caller invokes GetUser over the Security route.
Entry operation GetUser
Owning component SAIF.Services.WCF.Services.Security.SecurityService.GetUser
Inputs Request message parts listed below
Outputs A User projection from whichever source resolved first.
Failure behavior Generic SOAP fault, per Faults and error pipeline

Request and response

Direction Element Type Declared in Notes
Request userId string BCL (System) Account identifier to resolve across internal and external sources. (Yes)
Response User User External contracts assembly (SAIF.Services.WCF.Contracts / framework closure) ** A User projection from whichever source resolved first.

Steps

  1. LogRequestDetails logs the operation name and arguments (BR-WCF-032).
  2. UserFactory.TryGetInternalUser(userId) opens a PrincipalContext on domain SAIF and calls UserPrincipal.FindByIdentity(context, IdentityType.SamAccountName, userId); on a hit, project via GetInternalUser (BR-WCF-026a).
  3. On a directory miss, TryGetWcisEmployeeUser queries WcisEmployee by upper-cased id and marks the user active unless the status code is IN (BR-WCF-027a).
  4. On a further miss, TryGetAdpUser queries Employee by user id and marks the user active only when EmployeeStatusCode == "A" (BR-WCF-028a).
  5. Falling through all internal sources, TryGetExternalUser(userId) queries ExternalUser by upper-cased user id (BR-WCF-019a, BR-WCF-020a).
  6. Falling through everything, GetEmptyUser(userId) returns a User with Exists = false, an empty contact, and all flags false (BR-WCF-018a).
  7. Return.
  8. On failure: a directory or Oracle/NHibernate exception is logged by the installed error handler and surfaced as a generic SOAP fault with exception detail included.

Process flow

The following diagram visualizes this process's control flow.

flowchart TD
    A["Log request details"]
    B["Look up user in Active<br>Directory (SAIF domain)"]
    B1{"AD hit?"}
    B2["Project via GetInternalUser"]
    C["Look up user in WCIS<br>employee table"]
    C1{"WCIS hit?"}
    D["Look up user in ADP<br>employee table"]
    D1{"ADP hit?"}
    E["Look up user in<br>external-user table"]
    E1{"External hit?"}
    F["Return non-existent user"]
    G["Return."]
    A --> B
    B --> B1
    B1 -->|"Hit"| B2
    B1 -->|"Miss"| C
    B2 --> G
    C --> C1
    C1 -->|"Hit"| G
    C1 -->|"Miss"| D
    D --> D1
    D1 -->|"Hit"| G
    D1 -->|"Miss"| E
    E --> E1
    E1 -->|"Hit"| G
    E1 -->|"Miss"| F
    F --> G

Transaction and side effects

Aspect Finding
Unit of work OracleUnitOfWorkFactory (EXTUR)
Commit point Not applicable — read-only across all sources
Records written WcisEmployee, Employee, ExternalUser, ExternalUserType, Person (read only, first match wins)
Downstream calls Active Directory (SAIF domain)
Shared state touched None
Repeat-call behavior Idempotent read; same precedence chain re-evaluated each call

Logging

Surface Written content
HttpContext.Current.Response.AppendToLog (LogRequestDetails) Writes IIS request-detail log lines when LOG_REQUEST_DETAILS is enabled
ErrorLogErrorHandler → LogService Failure-path exception logging only, carrying method signature, calling user and exception detail; see Faults and error pipeline

Faults and error handling

Failure Fault type the caller receives Produced by Source
Directory or Oracle/NHibernate exception Generic SOAP fault The ErrorLogErrorHandler installed by [LogErrorBehavior] src/WCF/SAIF.Services.WCF.Host/Services/Security/Users/UserFactory.cs

Authorization

Requirement Enforced by Source Applies to
None in code IIS authentication on the deployment (see Activation and hosting) src/WCF/SAIF.Services.WCF.Host/Services/Security/SecurityService.cs This operation

Note: Statements marked with * were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts. Statements marked with ** could not be confirmed; treat as unknown until verified.

Sources

  • src/WCF/SAIF.Services.WCF.Host/Services/Security/SecurityService.cs
  • src/WCF/SAIF.Services.WCF.Host/Services/Security/Users/UserFactory.cs