Orech.Identity.Client 1.4.0

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

Orech.Identity.Client

Biblioteca client para integração com o Orech IdentityService: validação de JWT via JWKS, cache de permissões em Redis, multi-tenant e multi-branch.

Instalação

dotnet add package Orech.Identity.Client

Uso mínimo

builder.Services.AddIdentityClient(o =>
{
    o.Issuer          = "https://identity.suaempresa.com";
    o.JwksUri         = "https://identity.suaempresa.com/.well-known/jwks.json";
    o.ApplicationId   = Guid.Parse("<GUID da app no IdentityService>"); // obrigatório (1.2.0+)
    o.ApplicationSlug = "minha-app";
    o.ApiKey          = builder.Configuration["Identity:ApiKey"]!;       // X-Api-Key do sync
    o.RedisConnection = builder.Configuration["Redis:Connection"]!;

    o.Permissions.Add(new("members.read", "Ver membros"));
    o.RolesTemplate.Add(new("Admin", ["members.read", "members.write"]));
});

app.UseIdentityClient(); // middlewares: tenant, branch, permission

No startup, o client sincroniza permissões e template de roles com o IdentityService (POST /api/registry/sync, header X-Api-Key) de forma idempotente (merge aditivo).

Validação

Tokens são validados contra o JWKS do issuer, com aud == ApplicationId (rejeita tokens de outra aplicação). Permissões são resolvidas via cache Redis por permissions:{userId}:{tenantId}:{appId}:permissions.

Tratamento de erro

Falhas do IdentityService chegam no contrato canônico application/problem+json (OrechProblemDetails: code, message, status, correlation_id, errors?). O correlation_id permite cruzar os logs do seu app com os do IdentityService.


Requer .NET 10. Consulte o INTEGRATION-GUIDE.md para o onboarding completo de uma app nova.

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.4.0 63 6/7/2026
1.3.0 56 6/6/2026
1.2.0 56 6/5/2026
1.1.0 67 6/4/2026
1.0.0 73 6/2/2026