Rask.Auth.Client 0.22.1-alpha.0.6

This is a prerelease version of Rask.Auth.Client.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Rask.Auth.Client --version 0.22.1-alpha.0.6
                    
NuGet\Install-Package Rask.Auth.Client -Version 0.22.1-alpha.0.6
                    
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="Rask.Auth.Client" Version="0.22.1-alpha.0.6" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Rask.Auth.Client" Version="0.22.1-alpha.0.6" />
                    
Directory.Packages.props
<PackageReference Include="Rask.Auth.Client" />
                    
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 Rask.Auth.Client --version 0.22.1-alpha.0.6
                    
#r "nuget: Rask.Auth.Client, 0.22.1-alpha.0.6"
                    
#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 Rask.Auth.Client@0.22.1-alpha.0.6
                    
#: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=Rask.Auth.Client&version=0.22.1-alpha.0.6&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Rask.Auth.Client&version=0.22.1-alpha.0.6&prerelease
                    
Install as a Cake Tool

Rask.Auth.Client

The browser half of Rask.Auth. Register it and a WebAssembly app has the same three flows a server-rendered one has — written the same way.

var builder = WasmHostBuilder.CreateDefault();
builder.Services.AddRaskAuthClient();
await builder.RunAsync<App>();

That is the whole of it. After that a component reads the current user and signs somebody in with exactly the code it would use on the Server host:

public sealed class LoginForm(IAuth auth) : Component
{
    private async Task SubmitAsync(Credentials c) =>
        await auth.SignInAsync(c.Email, c.Password, returnUrl: "/");
}

public sealed class Header(IUserProvider users) : Component
{
    protected override Component Render() =>
        Authorize
            .NotAuthorized(NavLink.Href("/login")["Sign in"])
            .Authorized(user => Span[$"Hi, {user.Identity?.Name}"]);
}

What it does

AddRaskAuthClient() replaces the browser host's anonymous IUserProvider with one that reads the app's own GET /api/auth/me, and registers an IAuth that posts to /api/auth/register, /login and /logout. Calls are same-origin, so the auth cookie rides along on its own — no token is ever held in JavaScript, and there is nothing for a script on the page to read.

The current user is loaded before the first render, so a page never paints anonymous and then flips.

What it deliberately does not carry

The accounts and Entity Framework. Those live in Rask.Auth, on the server, and have no business in a trimmed browser publish. The two halves agree through the AuthApi wire contract in Rask.Core rather than by referencing each other.

Full documentation: rask.sh · docs/authentication.md

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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.  net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Rask.Auth.Client:

Package Downloads
Rask

The one reference a Rask application needs, server or browser. On a server target (net10.0 or net11.0) it brings the ASP.NET host plus every battery — database (SQLite, PostgreSQL or SQL Server, picked by Rask:Database:Provider), mediator, background jobs, transactional email, cache, file storage, outbox, operator dashboard, durable logs, Web Push, and SQLite snapshots and continuous backup — with RaskApp.Create(args) as the entry point. On a browser target it brings the WebAssembly host, the source-generated mediator, the query cache and remote dispatch. Everything referenced is wired and on; app.Configure(c => c.Jobs.Off()) is how an app does without one. Reference Rask.Server for a lean host with no database.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.22.1-alpha.0.12 0 9/16/2026
0.22.1-alpha.0.9 0 9/16/2026
0.22.1-alpha.0.8 0 9/16/2026
0.22.1-alpha.0.7 0 9/16/2026
0.22.1-alpha.0.6 0 9/16/2026
0.22.1-alpha.0.4 0 9/16/2026
0.22.1-alpha.0.3 0 9/16/2026
0.22.1-alpha.0.2 0 9/16/2026
0.22.1-alpha.0.1 0 9/16/2026
0.22.0 0 9/16/2026
0.21.1-alpha.0.88 0 9/16/2026
0.21.1-alpha.0.87 26 9/15/2026
0.21.1-alpha.0.83 33 9/15/2026
0.21.1-alpha.0.81 31 9/15/2026
0.21.1-alpha.0.80 33 9/15/2026
0.21.1-alpha.0.79 31 9/15/2026
0.21.1-alpha.0.78 27 9/15/2026
0.21.1-alpha.0.77 29 9/15/2026
0.21.1-alpha.0.76 33 9/15/2026
Loading failed