LumoAuth 1.6.0
dotnet add package LumoAuth --version 1.6.0
NuGet\Install-Package LumoAuth -Version 1.6.0
<PackageReference Include="LumoAuth" Version="1.6.0" />
<PackageVersion Include="LumoAuth" Version="1.6.0" />
<PackageReference Include="LumoAuth" />
paket add LumoAuth --version 1.6.0
#r "nuget: LumoAuth, 1.6.0"
#:package LumoAuth@1.6.0
#addin nuget:?package=LumoAuth&version=1.6.0
#tool nuget:?package=LumoAuth&version=1.6.0
LumoAuth
The official LumoAuth SDK for .NET 8 and newer. It lets .NET code ask whether a user or an AI agent may do something, and act on the answer:
- Authorization checks: role-based (RBAC), relationship-based (Zanzibar) and attribute-based (ABAC).
- Sign-in: OAuth 2.1 and OpenID Connect, including an authorization-code flow with PKCE.
- AI agents: capabilities, budgets, human approvals, Just-in-Time (JIT) permissions, delegation, MCP tokens, MCP tool checks and AAuth request signing.
Every call is async and accepts a CancellationToken. Every failure is an exception that you can catch by type.
Install
dotnet add package LumoAuth
The package targets .NET 8. Its only dependency is BouncyCastle.Cryptography, which is used for Ed25519 keys.
Quick start
using LumoAuth;
using LumoAuth.Models;
// Reads LUMOAUTH_URL, LUMOAUTH_ORG_ID and LUMOAUTH_API_KEY
using var lumo = LumoAuthClient.FromEnvironment();
bool canEdit = await lumo.Permissions.CheckAsync("document.edit");
bool canView = await lumo.Zanzibar.IsViewerAsync("document:readme", "user:bob");
An AI agent uses LumoAgent, which fetches and refreshes its own token:
// Reads AGENT_CLIENT_ID, AGENT_CLIENT_SECRET and LUMOAUTH_ORG_ID
using var agent = LumoAgent.FromEnvironment();
ApprovalResult ok = await agent.Approvals.RequireAsync(new ApprovalRequest
{
TaskId = "wire-001",
Reason = "Wire $4,500 to INV-7741",
OnBehalfOf = "ada@acme.com",
Impact = ApprovalImpact.High,
});
Configuration
| Environment variable | Option | Meaning | Default |
|---|---|---|---|
LUMOAUTH_URL |
BaseUrl |
LumoAuth region URL. The EU region is https://eu.app.lumoauth.dev. |
https://app.lumoauth.dev |
LUMOAUTH_ORG_ID |
OrgId |
Your organization's slug | none |
LUMOAUTH_API_KEY |
ApiKey |
Organization API key, sent as X-API-Key |
none |
AGENT_CLIENT_ID |
LumoAgentOptions.ClientId |
Agent OAuth client ID | none |
AGENT_CLIENT_SECRET |
LumoAgentOptions.ClientSecret |
Agent OAuth client secret | none |
A user access token goes in AccessToken or TokenProvider, or you can call lumo.WithAccessToken(token). Organization API keys work only on the admin API, client registration and the permission and Zanzibar checks. The ABAC routes need a user access token. Some calls also need an OAuth scope on that token, for example authz:read to list permissions or abac:read for ABAC.
Main types
| Type | Namespace | What it does |
|---|---|---|
LumoAuthClient |
LumoAuth |
The client. Its namespaces are Permissions, Zanzibar, Abac, Auth, Agents, Approvals, Jit, Delegation and Mcp. |
LumoAgent |
LumoAuth |
An agent client that manages its own token. |
JitContext |
LumoAuth |
Runs one JIT task and revokes its tokens when disposed. |
DelegationChain |
LumoAuth |
Lets an agent act on behalf of a user. |
AuthorizationCodeFlow |
LumoAuth.Web |
Signs users in with the authorization-code flow and PKCE. |
AAuthClient, AAuthVerifier, JwksCache |
LumoAuth.AAuth |
Agent request signing and token verification. |
LumoAuthException and subclasses |
LumoAuth.Errors |
The error types. A 403 caused by a missing scope lists the scopes in RequiredScopes. |
Building an ASP.NET Core app? Add the LumoAuth.AspNetCore package for configuration binding, authentication schemes, [RequirePermission] and a health check.
More information
- Full guide, scopes table, API reference and troubleshooting: github.com/lumoauth/sdk-csharp
- Documentation: docs.lumoauth.dev
| 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 was computed. 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 was computed. 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. |
-
net8.0
- BouncyCastle.Cryptography (>= 2.5.1)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on LumoAuth:
| Package | Downloads |
|---|---|
|
LumoAuth.AspNetCore
ASP.NET Core integration for the LumoAuth SDK: dependency injection from configuration, a bearer-token authentication scheme, OpenID Connect sign-in, [RequirePermission] / [RequireRelation] / [RequireAbac] authorization policies, and a health check. |
GitHub repositories
This package is not used by any popular GitHub repositories.