Delage.Identity.Client
2.1.3
dotnet add package Delage.Identity.Client --version 2.1.3
NuGet\Install-Package Delage.Identity.Client -Version 2.1.3
<PackageReference Include="Delage.Identity.Client" Version="2.1.3" />
paket add Delage.Identity.Client --version 2.1.3
#r "nuget: Delage.Identity.Client, 2.1.3"
// Install Delage.Identity.Client as a Cake Addin
#addin nuget:?package=Delage.Identity.Client&version=2.1.3
// Install Delage.Identity.Client as a Cake Tool
#tool nuget:?package=Delage.Identity.Client&version=2.1.3
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 HttpClient
s 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 | Versions 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. |
-
net6.0
- IdentityModel.OidcClient (>= 5.2.1)
- Microsoft.Extensions.DependencyInjection (>= 8.0.0)
- Microsoft.Extensions.Options (>= 8.0.2)
- OpenIddict.Validation.AspNetCore (>= 5.2.0)
- OpenIddict.Validation.SystemNetHttp (>= 5.2.0)
- Swashbuckle.AspNetCore.SwaggerGen (>= 6.5.0)
- Swashbuckle.AspNetCore.SwaggerUI (>= 6.5.0)
-
net7.0
- IdentityModel.OidcClient (>= 5.2.1)
- Microsoft.Extensions.DependencyInjection (>= 8.0.0)
- Microsoft.Extensions.Options (>= 8.0.2)
- OpenIddict.Validation.AspNetCore (>= 5.2.0)
- OpenIddict.Validation.SystemNetHttp (>= 5.2.0)
- Swashbuckle.AspNetCore.SwaggerGen (>= 6.5.0)
- Swashbuckle.AspNetCore.SwaggerUI (>= 6.5.0)
-
net8.0
- IdentityModel.OidcClient (>= 5.2.1)
- Microsoft.Extensions.DependencyInjection (>= 8.0.0)
- Microsoft.Extensions.Options (>= 8.0.2)
- OpenIddict.Validation.AspNetCore (>= 5.2.0)
- OpenIddict.Validation.SystemNetHttp (>= 5.2.0)
- Swashbuckle.AspNetCore.SwaggerGen (>= 6.5.0)
- Swashbuckle.AspNetCore.SwaggerUI (>= 6.5.0)
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.