Logto.ManagementApi 1.0.3

dotnet add package Logto.ManagementApi --version 1.0.3
                    
NuGet\Install-Package Logto.ManagementApi -Version 1.0.3
                    
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="Logto.ManagementApi" Version="1.0.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Logto.ManagementApi" Version="1.0.3" />
                    
Directory.Packages.props
<PackageReference Include="Logto.ManagementApi" />
                    
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 Logto.ManagementApi --version 1.0.3
                    
#r "nuget: Logto.ManagementApi, 1.0.3"
                    
#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 Logto.ManagementApi@1.0.3
                    
#: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=Logto.ManagementApi&version=1.0.3
                    
Install as a Cake Addin
#tool nuget:?package=Logto.ManagementApi&version=1.0.3
                    
Install as a Cake Tool

Logto.ManagementApi

An unofficial .NET client library for the Logto Management API. Handles machine-to-machine (M2M) authentication automatically, including token acquisition and refresh. This library is for interacting with Logto's management API. It provides no support in providing client/server side authentication/authorization of users or machine-to-machine (MTM) tokens. If you are looking for that, please refer to Logto C# page.

Features

  • Covers the full Logto Management API surface (users, organizations, applications, roles, connectors, sign-in experience, and more)
  • M2M client credentials flow handled transparently — no manual token management
  • Supports both Logto Cloud and self-hosted OSS instances
  • Designed for ASP.NET Core dependency injection

Installation

dotnet add package Logto.ManagementApi

Configuration

You will need a Machine-to-Machine application in your Logto tenant with the Management API resource assigned. The client ID and secret come from that application.

Logto Cloud

builder.Services.AddLogtoMgmtApiClient(options =>
{
    options.TenantId = "your-tenant-id";
    options.ManagementApiClientId = "your-m2m-client-id";
    options.ManagementClientSecret = "your-m2m-client-secret";
});

Self-hosted (Logto OSS)

builder.Services.AddLogtoMgmtApiClient(options =>
{
    options.BaseUrl = "https://auth.example.com";
    options.ManagementApiClientId = "your-m2m-client-id";
    options.ManagementClientSecret = "your-m2m-client-secret";
});

Usage

Inject ILogtoMgmtApiClient wherever you need it:

public class UserService(ILogtoMgmtApiClient logto)
{
    public async Task<string[]> GetUserEmailsAsync(CancellationToken ct)
    {
        var users = await logto.Users.GetUsersAsync(cancellationToken: ct);
        return users.Select(u => u.PrimaryEmail).OfType<string>().ToArray();
    }
}

Available endpoint groups on ILogtoMgmtApiClient:

Property Description
Users User management
Organizations Organization management
Applications Application management
Roles / OrganizationRoles Role management
Resources API resource management
Connectors Social/enterprise connector management
SignInExperience Sign-in experience configuration
AuditLogs Audit log access
Hooks Webhook management
Domains Custom domain management
Dashboard Usage statistics
... And more

License

Distributed under the MIT License. See the LICENSE file for more information.

Product Compatible and additional computed target framework versions.
.NET 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
1.0.3 131 6/20/2026
1.0.2 120 6/20/2026