Rask.Auth.Api
0.21.1-alpha.0.87
dotnet add package Rask.Auth.Api --version 0.21.1-alpha.0.87
NuGet\Install-Package Rask.Auth.Api -Version 0.21.1-alpha.0.87
<PackageReference Include="Rask.Auth.Api" Version="0.21.1-alpha.0.87" />
<PackageVersion Include="Rask.Auth.Api" Version="0.21.1-alpha.0.87" />
<PackageReference Include="Rask.Auth.Api" />
paket add Rask.Auth.Api --version 0.21.1-alpha.0.87
#r "nuget: Rask.Auth.Api, 0.21.1-alpha.0.87"
#:package Rask.Auth.Api@0.21.1-alpha.0.87
#addin nuget:?package=Rask.Auth.Api&version=0.21.1-alpha.0.87&prerelease
#tool nuget:?package=Rask.Auth.Api&version=0.21.1-alpha.0.87&prerelease
Rask.Auth.Api
Accounts as JSON endpoints, for an ASP.NET Core app that renders no Rask components — a TypeScript SPA host, a meta-framework host, or a plain ASP.NET app where the front end owns the UI.
Register, sign in, sign out, /me, email confirmation and password reset, all at /api/auth, backed
by ASP.NET Core Identity (versioned password hashing, lockout, security stamps, token providers).
The first account to register becomes the administrator.
builder.Services.AddRaskAuth<AppDbContext>();
builder.Services.AddAuthorization();
var app = builder.Build();
app.UseAuthentication();
app.UseAuthorization();
app.MapRaskAuth(); // POST /register, /login, /logout — GET /me — plus the recovery flows
Map the tables in OnModelCreating and create the schema:
protected override void OnModelCreating(ModelBuilder modelBuilder) => modelBuilder.AddRaskAuth();
rask db add AddAuth && rask db update
Declare the account type once, anywhere in the app — the generator finds it, and adding a column is adding a property:
public class User : IdentityUser
{
}
Which package
| Rask.Auth.Api | This one. The front end owns sign-in; the host answers /api/auth. No components, no renderer, no Rask.Core. |
| Rask.Auth | The app is a Rask app. Everything here, plus overridable /login, /register and /logout pages and a host-neutral IAuth for components. |
| Rask.Auth.Client | The same flows called from a WebAssembly client. |
Reference one of the first two, never both: Rask.Auth already contains this package.
Why it is separate
Rask.Core — the renderer — is not a package of its own. It travels inside the host packages that
render components (Rask.Server, Rask.Wasm), so a host that renders nothing ships no copy of it.
A battery that needed Core could therefore not run on Rask.Spa.Hosting or Rask.Meta.Hosting at
all: the assembly is simply absent and the app aborts before Main.
This package is the accounts battery with that dependency removed. It talks to the wire contract in
Rask.Wire — the /api/auth paths, the request and response shapes, AuthResult — which the
browser-side Rask.Auth.Client also takes, so both halves agree without either one carrying the
renderer.
Bearer tokens
Cookies are the default and the right answer for anything running in a page. A non-browser caller opts in:
builder.Services.AddRaskAuth<AppDbContext>(o => o.Bearer = new BearerOptions { SigningKey = key });
Then send X-Rask-Auth-Mode: bearer alongside X-Rask-Auth and a sign-in answers with a token in
the body — never a cookie, never a header, so nothing stores it on the caller's behalf.
Confirmation and reset links go out through the app's own mail queue (Rask.Mail), so they survive a
restart between "the account exists" and "the email went out". An app with no mail battery is told it
cannot send a reset link rather than silently queueing one nowhere.
Part of Rask. Full documentation: https://rask.sh/docs/guides/authentication.
| Product | Versions 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. |
-
net10.0
- Microsoft.AspNetCore.Authentication.JwtBearer (>= 10.0.12)
- Microsoft.AspNetCore.Identity.EntityFrameworkCore (>= 10.0.12)
- Microsoft.EntityFrameworkCore (>= 10.0.12)
- Rask.Mail (>= 0.21.1-alpha.0.87)
- Rask.Wire (>= 0.21.1-alpha.0.87)
-
net11.0
- Microsoft.AspNetCore.Authentication.JwtBearer (>= 10.0.12)
- Microsoft.AspNetCore.Identity.EntityFrameworkCore (>= 10.0.12)
- Microsoft.EntityFrameworkCore (>= 10.0.12)
- Rask.Mail (>= 0.21.1-alpha.0.87)
- Rask.Wire (>= 0.21.1-alpha.0.87)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Rask.Auth.Api:
| Package | Downloads |
|---|---|
|
Rask.Auth
Register, sign in and sign out for a Rask app, on by default. Accounts are backed by ASP.NET Core Identity (versioned password hashing, lockout, security stamps) and exposed through Rask's own host-neutral surface — the same IUserProvider, Authorize component and [Authorize] routes work unchanged on the Server, WebAssembly, island, SPA and meta-framework hosts. Ships built-in overridable /login, /register and /logout pages plus the matching /api/auth endpoints, so a TypeScript front end gets the same flows. Email confirmation and password reset go out through the app's own mail queue, with /confirm-email, /forgot-password and /reset-password pages to match. The first account to register becomes the admin. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.21.1-alpha.0.87 | 0 | 9/15/2026 |
| 0.21.1-alpha.0.83 | 0 | 9/15/2026 |
| 0.21.1-alpha.0.81 | 0 | 9/15/2026 |
| 0.21.1-alpha.0.80 | 0 | 9/15/2026 |
| 0.21.1-alpha.0.79 | 0 | 9/15/2026 |
| 0.21.1-alpha.0.78 | 0 | 9/15/2026 |
| 0.21.1-alpha.0.77 | 0 | 9/15/2026 |
| 0.21.1-alpha.0.76 | 0 | 9/15/2026 |
| 0.21.1-alpha.0.75 | 0 | 9/15/2026 |
| 0.21.1-alpha.0.74 | 0 | 9/15/2026 |
| 0.21.1-alpha.0.73 | 0 | 9/15/2026 |
| 0.21.1-alpha.0.72 | 0 | 9/15/2026 |
| 0.21.1-alpha.0.71 | 0 | 9/15/2026 |
| 0.21.1-alpha.0.70 | 0 | 9/15/2026 |
| 0.21.1-alpha.0.69 | 0 | 9/15/2026 |
| 0.21.1-alpha.0.68 | 0 | 9/15/2026 |
| 0.21.1-alpha.0.67 | 26 | 9/14/2026 |
| 0.21.1-alpha.0.66 | 33 | 9/14/2026 |
| 0.21.1-alpha.0.65 | 29 | 9/14/2026 |
| 0.21.1-alpha.0.62 | 29 | 9/14/2026 |