Delage.Identity.Client 2.1.1

dotnet add package Delage.Identity.Client --version 2.1.1
NuGet\Install-Package Delage.Identity.Client -Version 2.1.1
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="Delage.Identity.Client" Version="2.1.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Delage.Identity.Client --version 2.1.1
#r "nuget: Delage.Identity.Client, 2.1.1"
#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 Delage.Identity.Client as a Cake Addin
#addin nuget:?package=Delage.Identity.Client&version=2.1.1

// Install Delage.Identity.Client as a Cake Tool
#tool nuget:?package=Delage.Identity.Client&version=2.1.1

Introduction

This project aims to enable any project within Delage to seamlessly integrate with our Identity service and provide authentication.

Usage

Authentication

Add to the appSettings.json file:

{
  "Identity": {
    "Authority": "{AUTHORITY_URL}",
    "Audiences": ["audience"],
    "Scopes": ["scope"],
    "EncryptionKey": "ABCDE..."
  }
}

On the ConfigureServices method:

services.AddDelageAuth();

Call UseAuthentication before UseEndpoints in the Configure method:

// omitted

app.UseAuthentication();

// omitted

app.UseEndpoints();

These steps will enable your service to authenticate through Delage's Identity provider.

Configuring Swagger

Call ConfigureDelageAuth in AddSwaggerGen during the ConfigureServices method:

services.AddSwaggerGen(c =>
{
    c.ConfigureDelageAuth(Configuration);
});

Call ConfigureDelageAuth in UseSwaggerUI during the Configure method:

app.UseSwagger();
app.UseSwaggerUI(c =>
{
    // omitted
    c.ConfigureDelageAuth(Configuration);
});

Authorized clients

Authorized clients are a wrapper around the AddHttpClient extension method from IHttpClientFactory. With authorized clients, you can seamlessly authenticate HttpClients that require authentication to access services protected by Delage's Identity provider.

Here is an example of how this can be achieved:

services.AddAuthorizedClient<IOrderService, OrderService>(
    (client, sp) =>
    {
        client.BaseAddress = new Uri("{API_BASE_URL}");
        return new OrderService(client);
    }, 
    options =>
    {
        options.Authority = "{AUTHORITY_URL}";
        options.Scope = "{SCOPE}";
        options.ClientId = "CLIENT_ID";
        options.ClientSecret = "CLIENT_SECRET";
    });

Supported .NET versions

  • .NET 6
  • .NET 7
  • .NET 8

Publishing

Follow SemVer guidelines to increment the version according to the changes made to the project in the Delage.Identity.Client.csproj file.

Once the changes are merged into the develop or master branches, the version will be published to our private NuGet feed located here. A public version will also be published on nuget.org when changes are merged into the master branch.

While in development (on the develop branch) the build number will be automatically appended to the version, e.g., 1.0.0-56.

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 is compatible.  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 Delage.Identity.Client:

Package Downloads
Delage.Maestro.Orders.Client

Delage's .NET client for Maestro Orders Service.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.1.1 118 3/14/2024
2.0.3 435 6/14/2023
2.0.1 245 6/14/2023