LondonFhirService.Providers.FHIR.STU3.LondonDataService
2.0.1
dotnet add package LondonFhirService.Providers.FHIR.STU3.LondonDataService --version 2.0.1
NuGet\Install-Package LondonFhirService.Providers.FHIR.STU3.LondonDataService -Version 2.0.1
<PackageReference Include="LondonFhirService.Providers.FHIR.STU3.LondonDataService" Version="2.0.1" />
<PackageVersion Include="LondonFhirService.Providers.FHIR.STU3.LondonDataService" Version="2.0.1" />
<PackageReference Include="LondonFhirService.Providers.FHIR.STU3.LondonDataService" />
paket add LondonFhirService.Providers.FHIR.STU3.LondonDataService --version 2.0.1
#r "nuget: LondonFhirService.Providers.FHIR.STU3.LondonDataService, 2.0.1"
#:package LondonFhirService.Providers.FHIR.STU3.LondonDataService@2.0.1
#addin nuget:?package=LondonFhirService.Providers.FHIR.STU3.LondonDataService&version=2.0.1
#tool nuget:?package=LondonFhirService.Providers.FHIR.STU3.LondonDataService&version=2.0.1
LondonFhirService.Providers.FHIR.STU3.LondonDataService
A FHIR STU3 provider for the London Data Service (LDS) FHIR® Care Connect API.
Creating the provider
public LdsStu3Provider(
LdsConfigurations configurations,
IHttpContextAccessor httpContextAccessor,
ILogger<LdsStu3Provider> logger = null,
TokenCredential tokenCredential = null)
| Parameter | Required | Description |
|---|---|---|
configurations |
Yes | The LdsConfigurations for the London Data Service. |
httpContextAccessor |
Yes | Used to forward the original caller's identity on each request. |
logger |
No | When null, a NullLogger<LdsStu3Provider> is used. |
tokenCredential |
No | The credential used to get the LDS access token. When null, a DefaultAzureCredential is built from configurations. |
Configuration
"LdsConfigurations": {
"Scope": "api://{lds-app-id}/.default",
"ManagedIdentityClientId": "",
"BaseUrl": "https://{lds-host}/",
"GetStructuredRecordRelativeUrl": "{relative-url}",
"TimeoutSeconds": 100,
"CallerAuthorizationHeaderName": "X-Original-Authorization",
"CallerObjectIdHeaderName": "X-Caller-Oid"
}
| Setting | Description |
|---|---|
Scope |
The Entra scope requested when getting the LDS access token. |
ManagedIdentityClientId |
Optional client id of a user-assigned managed identity. Only used when no tokenCredential is supplied. |
BaseUrl |
The base address of the LDS API. |
GetStructuredRecordRelativeUrl |
The relative URL of the get structured record operation. |
TimeoutSeconds |
The request timeout in seconds. Defaults to 100. |
CallerAuthorizationHeaderName |
The header used to forward the caller's Authorization value. Defaults to X-Original-Authorization. |
CallerObjectIdHeaderName |
The header used to forward the caller's oid claim. Defaults to X-Caller-Oid. |
Authentication
Requests to the LDS API identify the hosting application and, when one is available, the original caller:
- The hosting application is always sent, as a bearer token for
Scopein theAuthorizationheader. The provider gets this token from aTokenCredentialand reuses it until 30 seconds before it expires. - The original caller is read from the current
HttpContexton each request. TheirAuthorizationvalue is forwarded in theCallerAuthorizationHeaderNameheader, and theiroidclaim in theCallerObjectIdHeaderNameheader. Each header is only added when its value is present, so neither is sent when there is noHttpContext.
Choosing the credential
- Default (no
tokenCredential). The provider builds aDefaultAzureCredential, which tries each credential in its chain in turn and uses the first that succeeds. In an Azure web app with no other credentials configured, such asAZURE_*environment variables, that is expected to be the web app's managed identity.ManagedIdentityClientIdonly configures the managed identity step: when it is set, that step uses the named user-assigned managed identity instead of the system-assigned one. - Supplied
tokenCredential. The provider uses the credential you pass in, andManagedIdentityClientIdis ignored.
Local development
There is no managed identity on a developer machine. Rather than setting machine-wide AZURE_TENANT_ID,
AZURE_CLIENT_ID and AZURE_CLIENT_SECRET environment variables, which every other application using
DefaultAzureCredential would also pick up, supply a credential in Development only. Keep its values in
user secrets (dotnet user-secrets). If you keep them in a settings file such as appsettings.Development.json
instead, add that file to the host's .gitignore first so the client secret is never committed:
TokenCredential tokenCredential = null;
if (builder.Environment.IsDevelopment())
{
tokenCredential = new ClientSecretCredential(
tenantId: builder.Configuration["LdsCredentials:TenantId"],
clientId: builder.Configuration["LdsCredentials:ClientId"],
clientSecret: builder.Configuration["LdsCredentials:ClientSecret"]);
}
var ldsStu3Provider = new LdsStu3Provider(
ldsConfigurations,
httpContextAccessor,
ldsLogger,
tokenCredential);
Outside Development tokenCredential stays null, so the provider falls back to DefaultAzureCredential as
before.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Azure.Identity (>= 1.21.0)
- Hl7.Fhir.STU3 (>= 6.6.0)
- LondonFhirService.Providers.FHIR.STU3.Abstractions (>= 2.0.0)
- RESTFulSense (>= 3.2.0)
- Xeption (>= 2.9.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Release 2.0.1.0: no public API changes since 2.0.0.
Documented LdsStu3Provider configuration, authentication and the optional tokenCredential parameter in the README.
Dependency changes: Hl7.Fhir.STU3 6.4.0 to 6.6.0.