TCIS.Authentication.OpenIdConnect
1.0.0-rc.9
dotnet add package TCIS.Authentication.OpenIdConnect --version 1.0.0-rc.9
NuGet\Install-Package TCIS.Authentication.OpenIdConnect -Version 1.0.0-rc.9
<PackageReference Include="TCIS.Authentication.OpenIdConnect" Version="1.0.0-rc.9" />
<PackageVersion Include="TCIS.Authentication.OpenIdConnect" Version="1.0.0-rc.9" />
<PackageReference Include="TCIS.Authentication.OpenIdConnect" />
paket add TCIS.Authentication.OpenIdConnect --version 1.0.0-rc.9
#r "nuget: TCIS.Authentication.OpenIdConnect, 1.0.0-rc.9"
#:package TCIS.Authentication.OpenIdConnect@1.0.0-rc.9
#addin nuget:?package=TCIS.Authentication.OpenIdConnect&version=1.0.0-rc.9&prerelease
#tool nuget:?package=TCIS.Authentication.OpenIdConnect&version=1.0.0-rc.9&prerelease
TCIS.Authentication.OpenIdConnect
A library integrating OpenIdConnect (OIDC) and JWT Bearer authentication, supporting Keycloak/Custom Auth configuration for both Web Apps (redirect) and APIs (stateless). The library automatically reads configurations, standardizes claim mapping, and connects with the TCIS Context system (IWorkContext).
📦 Installation
dotnet add package TCIS.Authentication.OpenIdConnect
🚀 Usage
1. Web Application / Client (Requires Redirect Login - AddTOidc)
Used in MVC, Razor Pages, or Blazor applications that require users to log in via an Identity Provider's UI (e.g., Keycloak).
using TCIS.Authentication.OpenIdConnect;
var builder = WebApplication.CreateBuilder(args);
// Register OIDC from IConfiguration ("Authentication:Oidc" and "Authentication:TCIS" sections)
builder.Services.AddAuthentication(options => {
options.DefaultScheme = "Cookies";
options.DefaultChallengeScheme = "OpenIdConnect";
})
.AddCookie("Cookies")
.AddTOidc(builder.Configuration);
var app = builder.Build();
app.UseAuthentication();
app.UseAuthorization();
app.Run();
2. API / Microservice Application (Stateless - AddTJwtBearer)
Used in Backend APIs that only receive Tokens from the Client and do not perform redirections.
using TCIS.Authentication.OpenIdConnect;
var builder = WebApplication.CreateBuilder(args);
// Register JWT Bearer to validate tokens
builder.Services.AddAuthentication()
.AddTJwtBearer(builder.Configuration);
var app = builder.Build();
app.UseAuthentication();
app.UseAuthorization();
app.Run();
⚙️ Configuration (appsettings.json)
{
"Authentication": {
"Oidc": {
"Authority": "https://auth.tcis.local/realms/tcis",
"ClientId": "my-client-id",
"ClientSecret": "my-secret",
"ResponseType": "code",
"SaveTokens": true,
"ValidIssuer": "https://auth.tcis.local/realms/tcis",
"ValidAudience": "account"
},
"TCIS": {
"NameClaimType": "preferred_username",
"RoleClaimType": "roles"
}
}
}
⚙️ Core Components
AddTOidc: Automatically configuresOpenIdConnectOptions, attaching Event handlers likeOnTokenValidatedto properly map standard TCIS claims.AddTJwtBearer: Automatically configuresJwtBearerOptionsused for APIs/Microservices.
| 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
- FluentValidation (>= 11.11.0)
- FluentValidation.AspNetCore (>= 11.3.0)
- FluentValidation.DependencyInjectionExtensions (>= 11.11.0)
- Microsoft.AspNetCore.Authentication.JwtBearer (>= 8.0.0)
- Microsoft.AspNetCore.Authentication.OpenIdConnect (>= 8.0.0)
- Microsoft.Bcl.Memory (>= 10.0.7)
- Microsoft.Extensions.Configuration.Abstractions (>= 9.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 9.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.0)
- Microsoft.Extensions.Hosting.Abstractions (>= 9.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.0)
- Microsoft.Extensions.Options (>= 9.0.0)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 9.0.0)
- Microsoft.IdentityModel.JsonWebTokens (>= 8.4.0)
- System.IdentityModel.Tokens.Jwt (>= 8.4.0)
- TCIS.AspNetCore (>= 1.0.0-rc.9)
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.0-rc.9 | 24 | 7/21/2026 |
| 1.0.0-rc.8 | 26 | 7/21/2026 |
| 1.0.0-rc.7 | 43 | 7/17/2026 |
| 1.0.0-rc.6 | 51 | 7/7/2026 |
| 1.0.0-rc.5 | 57 | 7/7/2026 |
| 1.0.0-rc.4 | 61 | 6/24/2026 |
| 1.0.0-rc.2 | 57 | 5/12/2026 |
| 1.0.0-rc.1 | 61 | 5/12/2026 |