Hellmade.HubAuth.AspNetCore 0.2.0
Hellmade.HubAuth.AspNetCore
ASP.NET Core integration helpers for services using Hub as OIDC authority.
Includes
AddHubOidcAuthentication(...)-- configures Cookie + OpenID Connect authenticationHubOidcAuthenticationOptions-- issuer, client ID, service key, scopesHubPermissionGateMiddleware-- gates authenticated requests through Hub's permission checkHubPermissionGateOptions-- service key, excluded paths, skipped auth schemesHubUserProjectionClaimsTransformationBase-- abstract base for projecting Hub users into local storesHubUserProjectionContext-- context record passed to the upsert method
Scope
- Service authentication and permission gating wiring.
- Keep service-local authorization rules and entity-specific upsert logic in each consuming service.
Permission gate quick start
services.AddHubAuthServiceClients(options =>
{
options.HubApiBaseUrl = configuration["AUTH:Hub:ApiBaseUrl"] ?? string.Empty;
});
app.UseAuthentication();
app.UseMiddleware<HubPermissionGateMiddleware>(new HubPermissionGateOptions
{
ServiceKey = configuration["SERVICE:KEY"] ?? string.Empty,
SkipForAuthenticationSchemes = new[] { "PersonalAccessToken" }
});
app.UseAuthorization();
No packages depend on Hellmade.HubAuth.AspNetCore.
.NET 10.0
- Hellmade.HubAuth.ServiceClients (>= 0.2.0)
- Microsoft.AspNetCore.Authentication.OpenIdConnect (>= 10.0.0)