Udap.Server 0.0.2-preview003

This is a prerelease version of Udap.Server.
There is a newer version of this package available.
See the version list below for details.
dotnet add package Udap.Server --version 0.0.2-preview003
NuGet\Install-Package Udap.Server -Version 0.0.2-preview003
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.Server" Version="0.0.2-preview003" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Udap.Server --version 0.0.2-preview003
#r "nuget: Udap.Server, 0.0.2-preview003"
#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.Server as a Cake Addin
#addin nuget:?package=Udap.Server&version=0.0.2-preview003&prerelease

// Install Udap.Server as a Cake Tool
#tool nuget:?package=Udap.Server&version=0.0.2-preview003&prerelease

Udap.Server

UDAP logo

📦 This package

This package is intended to be used with Duende's Identity Server. Duende must be licensed if you are using it for anything more than testing and you make more than 1 million dollars a year. I am willing to build samples using other identity providers. Keep in mind Udap.Server is meant to add auto registration only. Then it relies on Identity Server for identity rather than build a complete identity provider server. There is great value Duende provides that would take a very long time to get correct.

This package contains a few extension methods and two endpoints. The first endpoint is an UDAP metadata endpoint, implementing Duende's IEndpointHandler interface allowing /.well-known/udap to render metadata. The only thing of interest in this endpoint is the registration_endpoint which points to the next endpoint, UdapDynamicClientRegistrationEndpoint. This code is a simple endpoint called as a delegate using the dotnet minimal api technique.

Program.cs could look like this.

TODO Work to do here to demonstrate how to use.

  • Update readme
  • Instructions on creating database. dotnet run /seed from Udap.Idp.Admin
  • Need to finish loading root CAs into database
  • Add and test other DBs like SQL, PostgreSql and CockroachDB. Maybe Windows Store? 😏

using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Serilog;
using Udap.Server;
using Udap.Server.Extensions;
using Udap.Server.Registration;

namespace Udap.Idp;

internal static class HostingExtensions
{
    public static WebApplication ConfigureServices(this WebApplicationBuilder builder)
    {
        if (! int.TryParse(Environment.GetEnvironmentVariable("ASPNETCORE_HTTPS_PORT"), out int sslPort))
        {
            sslPort = 5002;
        }

        var connectionString = builder.Configuration.GetConnectionString("DefaultConnection");

        // uncomment if you want to add a UI
        builder.Services.AddRazorPages();

        var migrationsAssembly = typeof(Program).Assembly.GetName().Name;
        builder.Services.AddIdentityServer(options =>
            {
                // https://docs.duendesoftware.com/identityserver/v6/fundamentals/resources/api_scopes#authorization-based-on-scopes
                options.EmitStaticAudienceClaim = true;
            })
            .AddConfigurationStore(options =>
            {
                options.ConfigureDbContext = b => b.UseSqlite(connectionString,
                    sql => sql.MigrationsAssembly(migrationsAssembly));
            })
            .AddOperationalStore(options =>
            {
                options.ConfigureDbContext = b => b.UseSqlite(connectionString,
                    sql => sql.MigrationsAssembly(migrationsAssembly));
            })
            .AddInMemoryIdentityResources(Config.IdentityResources)
            .AddInMemoryApiScopes(Config.ApiScopes)
            .AddInMemoryClients(Config.Clients)
            //TODO remove
            .AddTestUsers(TestUsers.Users)
            .AddUdapDiscovery()
            .AddUdapServerConfiguration()
            .AddUdapConfigurationStore(options =>
            {
                options.UdapDbContext = b => b.UseSqlite(connectionString,
                    sql => sql.MigrationsAssembly(typeof(UdapDiscoveryEndpoint).Assembly.FullName));
            });

        return builder.Build();
    }
    
    public static WebApplication ConfigurePipeline(this WebApplication app)
    { 
        app.UseSerilogRequestLogging();
    
        if (app.Environment.IsDevelopment())
        {
            app.UseDeveloperExceptionPage();
        }

        // uncomment if you want to add a UI
        app.UseStaticFiles();
        app.UseRouting();
            
        app.UseIdentityServer();

        app.MapPost("/connect/register", async (HttpContext httpContext, [FromServices] UdapDynamicClientRegistrationEndpoint endpoint) =>
        {
            //TODO:  Tests and response codes needed...    httpContext.Response
            await endpoint.Process(httpContext);
        })
        .AllowAnonymous()
        .Produces(StatusCodes.Status201Created)
        .Produces(StatusCodes.Status401Unauthorized);

        // uncomment if you want to add a UI
        app.UseAuthorization();
        app.MapRazorPages().RequireAuthorization();

        return app;
    }
}


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 was computed.  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.Server:

Package Downloads
Udap.UI

Package is a part of the UDAP reference implementation for .NET.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.3.40 32 5/4/2024
0.3.39 35 5/1/2024
0.3.38 72 4/30/2024
0.3.37 90 4/11/2024
0.3.36 78 4/10/2024
0.3.35 84 4/9/2024
0.3.34 84 4/8/2024
0.3.33 88 4/7/2024
0.3.32 90 4/5/2024
0.3.31 88 4/4/2024
0.3.30 82 4/4/2024
0.3.29 88 4/3/2024
0.3.28 75 4/3/2024
0.3.27 89 4/2/2024
0.3.26 74 4/2/2024
0.3.25 84 4/2/2024
0.3.24 98 3/24/2024
0.3.22 103 3/6/2024
0.3.21 89 3/6/2024
0.3.20 75 3/5/2024
0.3.19 93 3/2/2024
0.3.18 102 3/2/2024
0.3.13 86 3/1/2024
0.3.12 85 2/24/2024
0.3.10 92 2/14/2024
0.3.8 87 2/11/2024
0.3.7 87 2/11/2024
0.3.6 85 2/10/2024
0.3.5 87 2/10/2024
0.3.4 85 2/10/2024
0.3.2 87 2/10/2024
0.3.0 91 1/31/2024
0.2.21 207 10/24/2023
0.2.20 89 10/23/2023
0.2.19 107 10/20/2023
0.2.18 108 10/11/2023
0.2.17 104 10/5/2023
0.2.16 110 9/21/2023
0.2.15 105 9/21/2023
0.2.14 103 9/20/2023
0.2.13 97 9/20/2023
0.2.12 96 9/20/2023
0.2.11 91 9/19/2023
0.2.10 128 9/13/2023
0.2.9 194 8/26/2023
0.2.8 115 8/18/2023
0.2.7 132 8/15/2023
0.2.6 131 8/12/2023
0.2.5 139 8/11/2023
0.2.4 120 8/10/2023
0.2.3 130 8/2/2023
0.2.2 128 8/1/2023
0.2.1 130 7/25/2023
0.2.0 148 7/16/2023
0.1.24 121 5/26/2023
0.1.23 139 5/22/2023
0.1.22 115 5/22/2023
0.1.21 116 5/21/2023
0.1.20 116 5/20/2023
0.1.17 109 5/9/2023
0.1.16 110 5/6/2023
0.1.15 117 5/4/2023
0.1.14 125 5/2/2023
0.1.12 125 5/1/2023
0.1.11 133 4/29/2023
0.1.9 140 4/29/2023
0.1.8 126 4/29/2023
0.1.7 134 4/28/2023
0.1.6 129 4/27/2023
0.1.5 124 4/27/2023
0.1.4 131 4/25/2023
0.1.3 146 4/23/2023
0.1.2 154 4/22/2023
0.1.1 149 4/22/2023
0.0.4-preview040 99 4/21/2023
0.0.4-preview039 105 4/13/2023
0.0.4-preview038 107 4/11/2023
0.0.4-preview037 101 4/7/2023
0.0.4-preview036 100 3/31/2023
0.0.4-preview035 105 3/31/2023
0.0.4-preview034 100 3/31/2023
0.0.4-preview033 102 3/30/2023
0.0.4-preview032 111 3/19/2023
0.0.4-preview029 107 3/18/2023
0.0.4-preview028 92 3/15/2023
0.0.4-preview027 110 3/13/2023
0.0.4-preview026 82 3/12/2023
0.0.4-preview025 101 3/10/2023
0.0.4-preview024 120 3/9/2023
0.0.4-preview022 108 3/9/2023
0.0.4-preview021 107 3/7/2023
0.0.4-preview020 107 3/7/2023
0.0.4-preview019 108 3/4/2023
0.0.4-preview018 109 3/4/2023
0.0.4-preview017 106 3/4/2023
0.0.4-preview016 116 3/1/2023
0.0.4-preview015 105 2/28/2023
0.0.4-preview014 127 2/23/2023
0.0.4-preview013 118 2/23/2023
0.0.4-preview012 116 2/21/2023
0.0.4-preview011 108 2/20/2023
0.0.4-preview010 113 2/20/2023
0.0.4-preview009 112 2/19/2023
0.0.4-preview008 89 2/14/2023
0.0.4-preview007 110 2/10/2023
0.0.4-preview006 110 2/8/2023
0.0.4-preview005 114 2/8/2023
0.0.4-preview004 110 2/7/2023
0.0.4-preview003 108 2/7/2023
0.0.4-preview002 116 2/7/2023
0.0.4-preview001 113 2/3/2023
0.0.4-preview000 122 2/2/2023
0.0.3-preview032 125 2/1/2023
0.0.3-preview031 112 2/1/2023
0.0.3-preview030 126 1/30/2023
0.0.3-preview029 123 1/21/2023
0.0.3-preview028 121 1/19/2023
0.0.3-preview027 105 1/18/2023
0.0.3-preview026 122 1/16/2023
0.0.3-preview025 121 1/15/2023
0.0.3-preview024 124 1/15/2023
0.0.3-preview020 117 1/15/2023
0.0.3-preview019 125 1/11/2023
0.0.3-preview018 124 1/11/2023
0.0.3-preview017 113 1/7/2023
0.0.3-preview016 110 1/7/2023
0.0.3-preview015 119 1/6/2023
0.0.3-preview014 115 1/6/2023
0.0.3-preview013 122 1/6/2023
0.0.3-preview012 117 1/6/2023
0.0.3-preview011 107 1/6/2023
0.0.3-preview010 116 1/3/2023
0.0.3-preview009 118 1/3/2023
0.0.3-preview008 118 1/2/2023
0.0.3-preview007 124 1/2/2023
0.0.3-preview006 113 1/2/2023
0.0.3-preview005 108 1/2/2023
0.0.3-preview004 105 1/1/2023
0.0.3-preview003 115 12/31/2022
0.0.3-preview002 141 12/28/2022
0.0.3-preview001 160 12/21/2022
0.0.3-preview000 113 11/29/2022
0.0.2-preview003 84 11/4/2022
0.0.2-preview002 90 11/4/2022
0.0.2-preview000 113 11/4/2022
0.0.1-preview3373625764 135 11/1/2022
0.0.1-preview002 121 11/4/2022
0.0.1-preview001 114 11/4/2022