Udap.Metadata.Server 0.3.83

There is a newer version of this package available.
See the version list below for details.
dotnet add package Udap.Metadata.Server --version 0.3.83                
NuGet\Install-Package Udap.Metadata.Server -Version 0.3.83                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Udap.Metadata.Server" Version="0.3.83" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Udap.Metadata.Server --version 0.3.83                
#r "nuget: Udap.Metadata.Server, 0.3.83"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Udap.Metadata.Server as a Cake Addin
#addin nuget:?package=Udap.Metadata.Server&version=0.3.83

// Install Udap.Metadata.Server as a Cake Tool
#tool nuget:?package=Udap.Metadata.Server&version=0.3.83                

Udap.Metadata.Server

UDAP logo

📦 Nuget Package: Udap.Client

This package includes a MVC controller, an extension method to load, and an implementation if ICertificateStore as FileCertificateStore so you can get a sample up and running quickly.

Program.cs could be as easy as this example.


using Udap.Common;
using Udap.Metadata.Server;

var builder = WebApplication.CreateBuilder(args);
builder.Services
    .AddControllers()
    .UseUdapMetaDataServer(builder.Configuration);

builder.Services.AddSingleton<ICertificateStore, MyCustomCertificateStore>();

Full Example

Below is a full example. Alternatively the 2023 FHIR® DevDays Tutorial is another great way to learn how to use Udap.Metadata.Server.

Add this package to your FHIR® server or any web api server to.


dotnet new sln -o WebApiProject1
cd WebApiProject1

dotnet new webapi -o WebApi1 -minimal
dotnet sln add ./WebApi1/WebApi1.csproj

cd WebApi1

dotnet add package Udap.Metadata.Server 

Or until a first release use the --prerelease tag.


dotnet add package Udap.Metadata.Server --prerelease

dotnet build

Add UseUdapMetaData to program.cs


 builder.Services
    .AddControllers()
    .AddUdapMetaDataServer(builder.Configuration);

AddUdapMetaDataServer extension will find the UdapMetadataOptions in AppSettings. These settings will match the IssuedCerts settings in UdapFileCertStoreManifest settings below.

Reference Required UDAP Metadata.

Issuer and Subject must match the issued certificates, Subject Alternative Name extension. The issued certificate is the first certificate present in the x5c JWT header.


"UdapMetadataOptions": {
  "UdapVersionsSupported": [ "1" ],
    "UdapProfilesSupported": [ "udap_dcr", "udap_authn", "udap_authz", "udap_to" ],
    "UdapAuthorizationExtensionsSupported": [ "hl7-b2b" ],
    "UdapAuthorizationExtensionsRequired": [ "hl7-b2b" ],
    "ScopesSupported": [ "openid", "system/*.read", "user/*.read", "patient/*.read" ],
    "UdapCertificationsSupported": [ "http://MyUdapCertification", "http://MyUdapCertification2" ],
    "UdapCertificationsRequired": [ "http://MyUdapCertification" ],
    "GrantTypesSupported": [ "authorization_code", "refresh_token", "client_credentials" ],
    //"TokenEndpointAuthSigningAlgValuesSupported": [ "RS256", "RS384", "ES256", "ES384" ],
    //"RegistrationEndpointJwtSigningAlgValuesSupported": [ "RS256", "RS384", "ES256", "ES384" ],
    
    "UdapMetadataConfigs": [
      {
        "Community": "http://localhost",
        "SignedMetadataConfig": {
          "AuthorizationEndPoint": "https://securedcontrols.net:5001/connect/authorize",
          "TokenEndpoint": "https://securedcontrols.net:5001/connect/token",
          "RegistrationEndpoint": "https://securedcontrols.net:5001/connect/register"
        }
      }
    ]
  }

To serve UDAP metadata, certificates will be loaded through an implementation of ICertificatStore. Below is a built-in file-based implementation for lab experiments.


// UDAP CertStore
builder.Services.Configure<UdapFileCertStoreManifest>(builder.Configuration.GetSection("UdapFileCertStoreManifest"));
builder.Services.AddSingleton<ICertificateStore, FileCertificateStore>();

To continue this example, copy the following files from the Udap.PKI.Generator test project output to the following directory structure at the root of the WebApi1 project. Ensure each file's "Copy to Output Directory" is set to copy.

  • CertStore
    • anchors
      • anchorLocalhostCert.cer
    • issued
      • weatherApiClientLocalhostCert.pfx
    • anchors
      • caLocalhostCert.cer

Add configuration to AppSettings to point to the certificates.

Note From AppSettings

UdapMetadataOptions:UdapMetadataConfigs:Community value is the link to UdapFileCertStoreManifest:ResourceServers:Communities.Name. So in this example the community is identified by the name http://localhost. Community names are constrained as a URI


/*   
  Normally put someplace safer like secrets.json or secured database
  and add this to Program.cs.    
*/

"UdapFileCertStoreManifest": {
  "Communities": [
    {
      "Name": "http://localhost",
      "Anchors": [
        {
          "FilePath": "CertStore/anchors/caLocalhostCert.cer"
        }
      ],
      "Intermediates": [
        "CertStore/intermediates/anchorLocalhostCert.cer"
      ],
      "IssuedCerts": [
        {
          "FilePath": "CertStore/issued/weatherApiClientLocalhostCert.pfx",
          "Password": "udap-test"
        }
      ]
    }
  ]    
}

dotnet run

Navigate to http://localhost:5079/.well-known/udap or http://localhost:5079/swagger.

A this point a success would result in a result similar to the following json. Ensure the signed_metadata property contains a signed JWT token.

<details open><summary><a>View Metadata</></summary>


{
  "udap_versions_supported": [
    "1"
  ],
  "udap_profiles_supported": [
    "udap_dcr",
    "udap_authn",
    "udap_authz"
  ],
  "udap_authorization_extensions_supported": [
    "hl7-b2b"
  ],
  "udap_authorization_extensions_required": [
    "hl7-b2b"
  ],
  "udap_certifications_supported": [
    "http://MyUdapCertification",
    "http://MyUdapCertification2"
  ],
  "udap_certifications_required": [
    "http://MyUdapCertification"
  ],
  "grant_types_supported": [
    "client_credentials"
  ],
  "scopes_supported": [
    "openid",
    "system/Patient.read",
    "system/AllergyIntolerance.read",
    "system/Procedures.read",
    "system/Observation.read"
  ],
  "authorization_endpoint": "https://securedcontrols.net/connect/authorize",
  "token_endpoint": "https://securedcontrols.net/connect/token",
  "token_endpoint_auth_methods_supported": [
    "private_key_jwt"
  ],
  "token_endpoint_auth_signing_alg_values_supported": [
    "RS256"
  ],
  "registration_endpoint": "https://securedcontrols.net/connect/register",
  "registration_endpoint_jwt_signing_alg_values_supported": [
    "RS256"
  ],
  "signed_metadata": "eyJhbGciOiJSUzI1NiIsIng1YyI6WyJNSUlGR3pDQ0JBT2dBd0lCQWdJSUZSVVJqcWdlTkdNd0RRWUpLb1pJaHZjTkFRRUxCUUF3Z2JNeEN6QUpCZ05WQkFZVEFsVlRNUk13RVFZRFZRUUlEQXBEWVd4cFptOXlibWxoT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xdjZpZTM2M01tZWp5WEtxeE1uUThHcUR1bVNBU1ZhbDhyVmw4ZjE1NzlwUDc4aGxDYWNzam4zdTBnNVJLRDVPUk4rQTlJTTRDMyJdfQ.eyJpc3MiOiJodHRwczovL3N0YWdlLmhlYWx0aHRvZ28ubWU6ODE4MSIsInN1YiI6Imh0dHBzOi8vc3RhZ2UuaGVhbHRodG9nby5tZTo4MTgxIiwiaWF0IjoxNjc2OTM3NjI3LCJleHAiOjE2NzY5Mzc2ODcsImp0aSI6Ik95N0RaenVhXzBYbDhEaFNRXzVONzFxeHFBcllLdEI3OUdmRkVGQVFaUkUiLCJhdXRob3JpemF0aW9uX2VuZHBvaW50IjoiaHR0cHM6Ly9zZWN1cmVkY29udHJvbHMubmV0L2Nvbm5lY3QvYXV0aG9yaXplIiwidG9rZW5fZW5kcG9pbnQiOiJodHRwczovL3NlY3VyZWRjb250cm9scy5uZXQvY29ubmVjdC90b2tlbiIsInJlZ2lzdHJhdGlvbl9lbmRwb2ludCI6Imh0dHBzOi8vc2VjdXJlZGNvbnRyb2xzLm5ldC9jb25uZWN0L3JlZ2lzdGVyIn0.Y9qWVQFs9HXWipN8YDrH7gf89FoA0V7f3p9vqc6bPuqrcI0B6wgqZ2ZC3FYi46nGvpe6G_H20edXYR7zIHqcXqhtjfYNmCYoH-ceVwvq6kCAm0c4v8BXN23SM1Eh72_481Bbf7PidHUzcAIOn7fJ9DAk-LiVsT9aa7TD2Aj11cLC5ZiuoHyLCOaf6sjK-yX707ov313TEQREgLbSnl-YTwbIgmm_h3fW4eSZH2eszdr3a3Q8BWKKVBphWos5TvQ77WsYfTt60JfFHEXO8Psq7n4bGm2ZcNApzoa9PIuimmzeN8vjyaLBu7lDi93cc9jKphYz3KpLh_-8ruHF2HqmNw"
}

</details> <br/>

UDAP Resource Server Examples

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Udap.Metadata.Server:

Package Downloads
Udap.Metadata.Vonk.Server

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.3.96 84 11/6/2024
0.3.95 75 11/2/2024
0.3.94 70 10/31/2024
0.3.93 140 10/13/2024
0.3.92 78 10/13/2024
0.3.91 77 10/10/2024
0.3.89 75 10/10/2024
0.3.87 76 10/5/2024
0.3.86 79 10/5/2024
0.3.85 81 10/4/2024
0.3.84 84 10/3/2024
0.3.83 80 10/3/2024
0.3.82 104 9/20/2024
0.3.81 79 9/19/2024
0.3.80 83 9/19/2024
0.3.79 85 9/19/2024
0.3.78 75 9/19/2024
0.3.77 80 9/17/2024
0.3.76 80 9/17/2024
0.3.75 84 9/12/2024
0.3.74 107 9/12/2024
0.3.73 102 9/10/2024
0.3.72 91 9/7/2024
0.3.71 104 9/5/2024
0.3.70 104 9/5/2024
0.3.69 104 9/5/2024
0.3.68 104 9/4/2024
0.3.67 93 9/4/2024
0.3.66 93 9/4/2024
0.3.65 101 9/4/2024
0.3.64 91 9/2/2024
0.3.63 97 8/31/2024
0.3.62 84 8/29/2024
0.3.61 93 8/28/2024
0.3.60 72 8/2/2024
0.3.59 82 8/1/2024
0.3.58 82 8/1/2024
0.3.57 96 7/19/2024
0.3.56 85 7/19/2024
0.3.54 100 7/18/2024
0.3.53 90 7/15/2024
0.3.52 84 7/15/2024
0.3.51 100 7/12/2024
0.3.50 97 7/1/2024
0.3.49 97 7/1/2024
0.3.48 136 5/22/2024
0.3.47 109 5/15/2024
0.3.46 89 5/14/2024
0.3.45 95 5/12/2024
0.3.44 98 5/12/2024
0.3.43 89 5/12/2024
0.3.42 90 5/12/2024
0.3.41 119 5/6/2024
0.3.40 128 5/4/2024
0.3.39 88 5/1/2024
0.3.38 153 4/30/2024
0.3.37 98 4/11/2024
0.3.36 108 4/10/2024
0.3.35 105 4/9/2024
0.3.34 112 4/8/2024
0.3.33 109 4/7/2024
0.3.32 110 4/5/2024
0.3.31 105 4/4/2024
0.3.30 111 4/4/2024
0.3.29 100 4/3/2024
0.3.28 112 4/3/2024
0.3.27 101 4/2/2024
0.3.26 102 4/2/2024
0.3.25 96 4/2/2024
0.3.24 188 3/24/2024
0.3.22 145 3/6/2024
0.3.21 130 3/6/2024
0.3.20 109 3/5/2024
0.3.19 119 3/2/2024
0.3.18 121 3/2/2024
0.3.13 126 3/1/2024
0.3.12 100 2/24/2024
0.3.10 107 2/14/2024
0.3.8 117 2/11/2024
0.3.7 106 2/11/2024
0.3.6 104 2/10/2024
0.3.5 115 2/10/2024
0.3.4 99 2/10/2024
0.3.2 113 2/10/2024
0.3.0 115 1/31/2024
0.2.21 232 10/24/2023
0.2.20 95 10/23/2023
0.2.19 134 10/20/2023
0.2.18 145 10/11/2023
0.2.17 139 10/5/2023
0.2.16 110 9/21/2023
0.2.15 114 9/21/2023
0.2.14 116 9/20/2023
0.2.13 109 9/20/2023
0.2.12 121 9/20/2023
0.2.11 120 9/19/2023
0.2.10 126 9/13/2023
0.2.9 195 8/26/2023
0.2.8 137 8/18/2023
0.2.7 154 8/15/2023
0.2.6 152 8/12/2023
0.2.5 157 8/11/2023
0.2.4 149 8/10/2023
0.2.3 203 8/2/2023
0.2.2 189 8/1/2023
0.2.1 187 7/25/2023
0.2.0 207 7/16/2023
0.1.24 166 5/26/2023
0.1.23 181 5/22/2023
0.1.22 164 5/22/2023
0.1.21 186 5/21/2023
0.1.20 164 5/20/2023
0.1.17 141 5/9/2023
0.1.16 114 5/6/2023
0.1.15 144 5/4/2023
0.1.14 158 5/2/2023
0.1.12 145 5/1/2023
0.1.11 141 4/29/2023
0.1.9 152 4/29/2023
0.1.8 147 4/29/2023
0.1.7 149 4/28/2023
0.1.6 143 4/27/2023
0.1.5 141 4/27/2023
0.1.4 144 4/25/2023
0.1.3 161 4/23/2023
0.1.2 150 4/22/2023
0.1.1 179 4/22/2023
0.0.4-preview040 122 4/21/2023
0.0.4-preview039 121 4/13/2023
0.0.4-preview038 116 4/11/2023
0.0.4-preview037 126 4/7/2023
0.0.4-preview036 120 3/31/2023
0.0.4-preview035 120 3/31/2023
0.0.4-preview034 122 3/31/2023
0.0.4-preview033 116 3/30/2023
0.0.4-preview032 178 3/19/2023
0.0.4-preview029 125 3/18/2023
0.0.4-preview028 124 3/15/2023
0.0.4-preview027 120 3/13/2023
0.0.4-preview026 98 3/12/2023
0.0.4-preview025 105 3/10/2023
0.0.4-preview024 123 3/9/2023
0.0.4-preview022 138 3/9/2023
0.0.4-preview021 132 3/7/2023
0.0.4-preview020 120 3/7/2023
0.0.4-preview019 119 3/4/2023
0.0.4-preview018 126 3/4/2023
0.0.4-preview017 121 3/4/2023
0.0.4-preview016 130 3/1/2023
0.0.4-preview015 124 2/28/2023
0.0.4-preview014 135 2/23/2023
0.0.4-preview013 125 2/23/2023
0.0.4-preview012 143 2/21/2023
0.0.4-preview011 138 2/20/2023
0.0.4-preview010 124 2/20/2023
0.0.4-preview009 133 2/19/2023
0.0.4-preview008 130 2/14/2023
0.0.4-preview007 119 2/10/2023
0.0.4-preview006 126 2/8/2023
0.0.4-preview005 129 2/8/2023
0.0.4-preview004 131 2/7/2023
0.0.4-preview003 122 2/7/2023
0.0.4-preview002 107 2/7/2023
0.0.4-preview001 124 2/3/2023
0.0.4-preview000 150 2/2/2023
0.0.3-preview032 128 2/1/2023
0.0.3-preview031 140 2/1/2023
0.0.3-preview030 140 1/30/2023
0.0.3-preview029 132 1/21/2023
0.0.3-preview028 134 1/19/2023
0.0.3-preview027 133 1/18/2023
0.0.3-preview026 130 1/16/2023
0.0.3-preview025 137 1/15/2023
0.0.3-preview024 129 1/15/2023
0.0.3-preview020 135 1/15/2023
0.0.3-preview019 153 1/11/2023
0.0.3-preview018 136 1/11/2023
0.0.3-preview017 138 1/7/2023
0.0.3-preview016 130 1/7/2023
0.0.3-preview015 135 1/6/2023
0.0.3-preview014 141 1/6/2023
0.0.3-preview013 135 1/6/2023
0.0.3-preview012 131 1/6/2023
0.0.3-preview011 131 1/6/2023
0.0.3-preview010 138 1/3/2023
0.0.3-preview009 143 1/3/2023
0.0.3-preview008 148 1/2/2023
0.0.3-preview007 144 1/2/2023
0.0.3-preview006 132 1/2/2023
0.0.3-preview005 122 1/2/2023
0.0.3-preview004 130 1/1/2023
0.0.3-preview003 125 12/31/2022
0.0.3-preview002 172 12/28/2022
0.0.3-preview001 158 12/21/2022
0.0.3-preview000 136 11/29/2022
0.0.2-preview003 138 11/4/2022
0.0.2-preview002 133 11/4/2022
0.0.2-preview000 162 11/4/2022
0.0.1-preview3373625764 168 11/1/2022
0.0.1-preview002 162 11/4/2022
0.0.1-preview001 168 11/4/2022