Sora.Web.Auth
0.4.0
dotnet add package Sora.Web.Auth --version 0.4.0
NuGet\Install-Package Sora.Web.Auth -Version 0.4.0
<PackageReference Include="Sora.Web.Auth" Version="0.4.0" />
<PackageVersion Include="Sora.Web.Auth" Version="0.4.0" />
<PackageReference Include="Sora.Web.Auth" />
paket add Sora.Web.Auth --version 0.4.0
#r "nuget: Sora.Web.Auth, 0.4.0"
#:package Sora.Web.Auth@0.4.0
#addin nuget:?package=Sora.Web.Auth&version=0.4.0
#tool nuget:?package=Sora.Web.Auth&version=0.4.0
Sylin.Sora.Web.Auth
Authentication scaffolding and shared components for Sora 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.Sora.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 Sora.Web.Auth.TestProvider in Development, its userinfo may include
roles[]
,permissions[]
, andclaims{}
. These are mapped into the cookie principal (roles → ClaimTypes.Role, permissions →sora.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
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0 is compatible. 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. |
-
net9.0
- Microsoft.AspNetCore.Authentication.OpenIdConnect (>= 9.0.0)
- Microsoft.Extensions.Http (>= 9.0.0)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 9.0.0)
- Newtonsoft.Json (>= 13.0.3)
- Sora.Core (>= 0.4.0)
NuGet packages (5)
Showing the top 5 NuGet packages that depend on Sora.Web.Auth:
Package | Downloads |
---|---|
Sora.Web.Auth.Oidc
Generic OIDC adapter for Sora.Web.Auth (handler wiring; no defaults). |
|
Sora.Web.Auth.Google
Google auth provider adapter for Sora.Web.Auth (self-registering defaults). |
|
Sora.Web.Auth.Microsoft
Microsoft (Entra ID) auth provider adapter for Sora.Web.Auth (self-registering defaults). |
|
Sora.Web.Auth.TestProvider
Package Description |
|
Sora.Web.Auth.Discord
Discord OAuth2 auth provider adapter for Sora.Web.Auth (self-registering defaults). |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated | |
---|---|---|---|
0.4.0 | 200 | 9/5/2025 |
See release notes: https://github.com/sylin-labs/sora-framework/releases