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
                    
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="Sora.Web.Auth" Version="0.4.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Sora.Web.Auth" Version="0.4.0" />
                    
Directory.Packages.props
<PackageReference Include="Sora.Web.Auth" />
                    
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 Sora.Web.Auth --version 0.4.0
                    
#r "nuget: Sora.Web.Auth, 0.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 Sora.Web.Auth@0.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=Sora.Web.Auth&version=0.4.0
                    
Install as a Cake Addin
#tool nuget:?package=Sora.Web.Auth&version=0.4.0
                    
Install as a Cake Tool

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[], and claims{}. 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.Discord

Discord OAuth2 auth provider adapter for Sora.Web.Auth (self-registering defaults).

Sora.Web.Auth.TestProvider

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.4.0 200 9/5/2025 0.4.0 is deprecated because it is no longer maintained.