Rask.Auth.Api
0.22.1-alpha.0.8
See the version list below for details.
dotnet add package Rask.Auth.Api --version 0.22.1-alpha.0.8
NuGet\Install-Package Rask.Auth.Api -Version 0.22.1-alpha.0.8
<PackageReference Include="Rask.Auth.Api" Version="0.22.1-alpha.0.8" />
<PackageVersion Include="Rask.Auth.Api" Version="0.22.1-alpha.0.8" />
<PackageReference Include="Rask.Auth.Api" />
paket add Rask.Auth.Api --version 0.22.1-alpha.0.8
#r "nuget: Rask.Auth.Api, 0.22.1-alpha.0.8"
#:package Rask.Auth.Api@0.22.1-alpha.0.8
#addin nuget:?package=Rask.Auth.Api&version=0.22.1-alpha.0.8&prerelease
#tool nuget:?package=Rask.Auth.Api&version=0.22.1-alpha.0.8&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, on the app's own
User aggregate: PBKDF2 or bcrypt password hashing, a session row per signed-in device that signing out elsewhere
or a password reset ends at once, throttling rather than lockout, and passkeys beside the password. 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 user type once, anywhere in the app — the generator finds it, and adding a column is adding a property:
public sealed class User : Authenticatable
{
public string DisplayName { get; private set; } = "";
}
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 a host-neutral IAuth for components; rask new writes the sign-in pages into the app. |
| 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
- BCrypt.Net-Next (>= 4.2.0)
- Microsoft.AspNetCore.Authentication.JwtBearer (>= 10.0.12)
- Microsoft.EntityFrameworkCore (>= 10.0.12)
- Rask.Data (>= 0.22.1-alpha.0.8)
- Rask.Mail (>= 0.22.1-alpha.0.8)
- Rask.Wire (>= 0.22.1-alpha.0.8)
-
net11.0
- BCrypt.Net-Next (>= 4.2.0)
- Microsoft.AspNetCore.Authentication.JwtBearer (>= 10.0.12)
- Microsoft.EntityFrameworkCore (>= 10.0.12)
- Rask.Data (>= 0.22.1-alpha.0.8)
- Rask.Mail (>= 0.22.1-alpha.0.8)
- Rask.Wire (>= 0.22.1-alpha.0.8)
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 the app's own User aggregate (PBKDF2 or bcrypt password hashing, passkeys beside the password, one revocable session row per signed-in device, sign-in throttling) and are exposed through Rask's own host-neutral surface — the same IUserProvider, Authorize component and [Authorize] routes work unchanged on the Server and WebAssembly hosts, islands included. rask new writes the /login, /register, /logout and /devices pages into the app, and the matching /api/auth endpoints give a TypeScript front end 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 scaffolded 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.23.1-alpha.0.2248 | 0 | 10/27/2026 |
| 0.23.1-alpha.0.2241 | 35 | 10/27/2026 |
| 0.23.1-alpha.0.2239 | 33 | 10/27/2026 |
| 0.23.1-alpha.0.526 | 51 | 10/26/2026 |
| 0.23.1-alpha.0.523 | 49 | 10/26/2026 |
| 0.23.1-alpha.0.515 | 44 | 10/26/2026 |
| 0.23.1-alpha.0.496 | 79 | 10/22/2026 |
| 0.23.1-alpha.0.493 | 62 | 10/22/2026 |
| 0.23.1-alpha.0.478 | 70 | 10/22/2026 |
| 0.23.1-alpha.0.470 | 72 | 10/22/2026 |
| 0.23.1-alpha.0.459 | 89 | 10/21/2026 |
| 0.23.1-alpha.0.458 | 63 | 10/21/2026 |
| 0.23.1-alpha.0.456 | 65 | 10/21/2026 |
| 0.23.1-alpha.0.453 | 64 | 10/22/2026 |
| 0.23.1-alpha.0.445 | 70 | 10/21/2026 |
| 0.23.1-alpha.0.440 | 71 | 10/21/2026 |
| 0.23.1-alpha.0.437 | 61 | 10/21/2026 |
| 0.23.1-alpha.0.436 | 69 | 10/21/2026 |
| 0.23.0 | 238 | 9/18/2026 |
| 0.22.1-alpha.0.8 | 68 | 9/16/2026 |