CommunityToolkit.Aspire.Logto.Client
13.4.1-beta.685
Prefix Reserved
dotnet add package CommunityToolkit.Aspire.Logto.Client --version 13.4.1-beta.685
NuGet\Install-Package CommunityToolkit.Aspire.Logto.Client -Version 13.4.1-beta.685
<PackageReference Include="CommunityToolkit.Aspire.Logto.Client" Version="13.4.1-beta.685" />
<PackageVersion Include="CommunityToolkit.Aspire.Logto.Client" Version="13.4.1-beta.685" />
<PackageReference Include="CommunityToolkit.Aspire.Logto.Client" />
paket add CommunityToolkit.Aspire.Logto.Client --version 13.4.1-beta.685
#r "nuget: CommunityToolkit.Aspire.Logto.Client, 13.4.1-beta.685"
#:package CommunityToolkit.Aspire.Logto.Client@13.4.1-beta.685
#addin nuget:?package=CommunityToolkit.Aspire.Logto.Client&version=13.4.1-beta.685&prerelease
#tool nuget:?package=CommunityToolkit.Aspire.Logto.Client&version=13.4.1-beta.685&prerelease
CommunityToolkit.Aspire.Logto.Client
Registers Logto authentication services in the DI container for connecting to a Logto instance using OpenID Connect or JWT Bearer authentication.
Getting started
Prerequisites
- A Logto instance (can be hosted via
CommunityToolkit.Aspire.Hosting.Logto).
Install the package
Install the Aspire Logto Client library with NuGet:
dotnet add package CommunityToolkit.Aspire.Logto.Client
Usage example
OpenID Connect (OIDC) Authentication
In the Program.cs file of your project, call the AddLogtoOIDC extension method to register Logto OIDC authentication for use via the dependency injection container. The method takes an optional connection name parameter.
builder.AddLogtoOIDC("logto");
JWT Bearer Authentication
For API projects that need to validate Logto-issued JWTs, use the AddLogtoJwtBearer extension method on the AuthenticationBuilder:
builder.Services
.AddAuthentication()
.AddLogtoJwtBearer("logto", "your-app-identifier");
Configuration
The Aspire Logto Client integration provides multiple options to configure the server connection based on the requirements and conventions of your project.
Use a connection string
When using a connection string from the ConnectionStrings configuration section, you can provide the name of the connection string when calling builder.AddLogtoOIDC():
builder.AddLogtoOIDC("logto");
And then the connection string will be retrieved from the ConnectionStrings configuration section:
{
"ConnectionStrings": {
"logto": "Endpoint=http://localhost:3001"
}
}
Use configuration providers
The Aspire Logto Client integration supports Microsoft.Extensions.Configuration. It loads the settings from configuration by using the Aspire:Logto:Client key. Example appsettings.json that configures some of the options:
{
"Aspire": {
"Logto": {
"Client": {
"Endpoint": "http://localhost:3001",
"AppId": "your-app-id",
"AppSecret": "your-app-secret"
}
}
}
}
Use inline delegates
You can also pass the Action<LogtoOptions> delegate to set up some or all the options inline, for example to set the AppId from code:
builder.AddLogtoOIDC("logto", logtoOptions: options =>
{
options.AppId = "your-app-id";
options.AppSecret = "your-app-secret";
});
AppHost extensions
In your AppHost project, install the CommunityToolkit.Aspire.Hosting.Logto library with NuGet:
dotnet add package CommunityToolkit.Aspire.Hosting.Logto
Then, in the Program.cs file of AppHost, register a Logto instance and consume the connection using the following methods:
var postgres = builder.AddPostgres("postgres");
var logto = builder.AddLogto("logto", postgres);
var myService = builder.AddProject<Projects.MyService>()
.WithReference(logto);
The WithReference method configures a connection in the MyService project named logto. In the Program.cs file of MyService, the Logto connection can be consumed using:
builder.AddLogtoOIDC("logto");
Additional documentation
Feedback & contributing
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. 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
- Logto.AspNetCore.Authentication (>= 0.2.0)
- Microsoft.AspNetCore.Authentication.JwtBearer (>= 8.0.16)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.8)
-
net8.0
- Logto.AspNetCore.Authentication (>= 0.2.0)
- Microsoft.AspNetCore.Authentication.JwtBearer (>= 8.0.16)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.8)
-
net9.0
- Logto.AspNetCore.Authentication (>= 0.2.0)
- Microsoft.AspNetCore.Authentication.JwtBearer (>= 8.0.16)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.8)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 13.4.1-beta.685 | 39 | 7/9/2026 |
| 13.4.1-beta.683 | 38 | 7/9/2026 |
| 13.4.1-beta.680 | 38 | 7/7/2026 |
| 13.4.1-beta.676 | 43 | 7/7/2026 |
| 13.4.1-beta.675 | 46 | 7/6/2026 |
| 13.4.1-beta.674 | 50 | 7/6/2026 |
| 13.4.0-beta.671 | 55 | 7/3/2026 |