Choose your AuthEndpoints sign-in setup
Start with the quick start when a browser signs in with a password and a cookie. Use this page when that is not the setup you need.
The password facade is AddPasswordAuth and MapPasswordAuth. It maps one session under /auth. Cookie is the default. JWT is the other session. It does not map email-code sign-in or external sign-in.
| You need | Call | Page |
|---|---|---|
| Password sign-in for a browser, with a cookie | AddPasswordAuth. Leave Session at Cookie. | Quick start |
| A JWT session | Session = Jwt, and a Jwt callback. | Password auth, JWT |
| A native client that stores the refresh token | JWT, and RefreshTokenTransport.Body. | JWT |
| Identity bearer tokens | AddBearerAuthEndpoints and MapBearerAuthEndpoints. | Bearer auth |
| Passkeys beside passwords | Set Passkeys.ServerDomain on the password facade. | Passkeys, Register users |
| Passkey login, and no public passkey register | MapSignInEndpoints with AddPasskeySignInEndpoints only. | Passkeys |
| An emailed code | AddEmailCodeEndpoints. Sign-up and the magic link default to off. | Sign in with an emailed code |
| GitHub or Google | A provider package, then MapExternalAuthEndpoints. | Register users |
| No public sign-up | Compose sign-in, and do not map register or external sign-in. | Run an app with no public sign-up |
| More than one session, or a custom mix | The Add* and Map* pair for each module. | Composition table, Build a custom auth stack |
Turn passkeys on
On the password facade, passkeys stay off until Passkeys.ServerDomain is a non-empty domain. That setting maps passkey sign-in and passkey management on the same prefix. Sign-in includes POST /passkeys/register, which creates an account. To map passkey login without that register route, follow Passkeys.
Add an emailed code
The password facade does not map email-code routes. Call AddEmailCodeEndpoints and map MapEmailCodeEndpoints on the prefix you choose. AllowSignUp defaults to false, so an unknown address does not become an account. MagicLink.Enabled defaults to false.
Add GitHub or Google
Install AuthEndpoints.OAuth.GitHub, AuthEndpoints.OAuth.Google, or both. Register the handler, then map MapExternalAuthEndpoints or MapExternalAuthProvider. The password facade does not map those routes.
A verified provider email creates an account when no local user has that email. There is no option to stop that. RequireVerifiedEmail defaults to true and refuses an unverified email. It does not stop creation for a verified email. See External OAuth.
Compose the pairs
Call the Add* method before the matching Map*. A missing Add* throws InvalidOperationException. The messages are in What you compose. The pairs, the routes, and the maps that contain each pair are in the composition table. Copy-paste hosts are in Build a custom auth stack.