Logto.ManagementApi
1.0.3
dotnet add package Logto.ManagementApi --version 1.0.3
NuGet\Install-Package Logto.ManagementApi -Version 1.0.3
<PackageReference Include="Logto.ManagementApi" Version="1.0.3" />
<PackageVersion Include="Logto.ManagementApi" Version="1.0.3" />
<PackageReference Include="Logto.ManagementApi" />
paket add Logto.ManagementApi --version 1.0.3
#r "nuget: Logto.ManagementApi, 1.0.3"
#:package Logto.ManagementApi@1.0.3
#addin nuget:?package=Logto.ManagementApi&version=1.0.3
#tool nuget:?package=Logto.ManagementApi&version=1.0.3
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 | Versions 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. |
-
net10.0
- Microsoft.Extensions.Http (>= 10.0.9)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.