CommunityToolkit.Aspire.Logto.Client 13.4.1-beta.685

Prefix Reserved
This is a prerelease version of CommunityToolkit.Aspire.Logto.Client.
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
                    
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="CommunityToolkit.Aspire.Logto.Client" Version="13.4.1-beta.685" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CommunityToolkit.Aspire.Logto.Client" Version="13.4.1-beta.685" />
                    
Directory.Packages.props
<PackageReference Include="CommunityToolkit.Aspire.Logto.Client" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add CommunityToolkit.Aspire.Logto.Client --version 13.4.1-beta.685
                    
#r "nuget: CommunityToolkit.Aspire.Logto.Client, 13.4.1-beta.685"
                    
#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.
#:package CommunityToolkit.Aspire.Logto.Client@13.4.1-beta.685
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=CommunityToolkit.Aspire.Logto.Client&version=13.4.1-beta.685&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=CommunityToolkit.Aspire.Logto.Client&version=13.4.1-beta.685&prerelease
                    
Install as a Cake Tool

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

https://github.com/CommunityToolkit/Aspire

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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