net10.0
Authentication core for Koan Web: IDP configuration, controller wiring, and claims transformation pipelines.
Published
May 16, 2026
5mo ago
Total Downloads
5.6K
5,643
Install
dotnet add package Sylin.Koan.Web.Auth --version 0.8.0
| Product | Versions |
|---|---|
| .NET |
README
Sylin.Koan.Web.Auth
Authentication scaffolding and shared components for Koan Web.
- Target framework: net9.0
- License: Apache-2.0
Capabilities
- Multi-protocol auth (OIDC/OAuth2)
- Discovery and health integration
- Provider adapters shipped as separate modules
Install
dotnet add package Sylin.Koan.Web.Auth
Usage - quick notes
- Configure providers via typed Options; avoid inline endpoints.
- Use MVC controllers with attribute routing for auth callbacks.
Dev/testing tip
- When using Koan.Web.Auth.Connector.Test in Development, its userinfo may include
roles[],permissions[], andclaims{}. These are mapped into the cookie principal (roles → ClaimTypes.Role, permissions →Koan.permission, claims{} → 1:1) so you can exercise authorization flows end-to-end.
Sign-out (controller)
[ApiController]
[Route("auth")]
public sealed class SignOutController : ControllerBase
{
[HttpPost("signout")]
[ValidateAntiForgeryToken]
public async Task<IActionResult> SignOutApp([FromForm] string? returnUrl)
{
await HttpContext.SignOutAsync();
// Validate returnUrl before redirecting
return LocalRedirect(string.IsNullOrEmpty(returnUrl) ? "/" : returnUrl);
}
}
See TECHNICAL.md for contracts and configuration.
References
- Decisions:
/docs/decisions/WEB-0043-auth-multi-protocol-oauth-oidc-saml.md,/docs/decisions/WEB-0044-web-auth-discovery-and-health.md,/docs/decisions/WEB-0045-auth-provider-adapters-separate-projects.md
Adoption Assessment
Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.
Compatibility metadata lists 1 target framework; confirm the exact target used by your application.
Related Guides & Workflows
Learn how to evaluate, integrate, or audit this package in your .NET project.