Skip to content
Menu

Sign-in and session hardening

View .md

This page covers how a person proves who they are (password, single sign-on, bearer token), how long that proof lasts, and what Beacon does when a sign-in is refused. Read it when you move a deployment from a test setup to production, when you turn off local passwords, or when you need to know what an operator sees after a failed sign-in.

Beacon has four ways in. Each ends in a different credential.

Way inCredentialPage that covers it
Browser, passwordBeacon.Auth session cookiethis page
Browser, single sign-on (OIDC)Beacon.Auth session cookiethis page
Program or MCP client, bearer tokenJWT in Authorization: Bearerthis page (JWT validation)
Program or MCP client, API keyAuthorization: Bearer sk-sem_...API keys

Who may do what after sign-in is a separate question. See Authorization and User management. Request limits on the login routes are on Rate limits and request limits.

Beacon checks its own credentials (cookie, API key, bearer token) on /beacon and on the path prefixes listed in Beacon:Authentication:AdditionalPaths. On every other route, those credentials do nothing, and Beacon never redirects a host route to its login page. The match is by whole path segment, ignoring case, against the path after the host’s path base.

KeyTypeDefaultRangeWhat it does
Beacon:Authentication:AdditionalPathslist of stringsemptyeach entry starts with /, is not / alone, has no ? or #; a trailing / is ignoredExtra prefixes where Beacon credentials apply.

Use it for a Warp dashboard that admits Beacon admins, or for the OpenAPI document when you want a Beacon session to open it.

{
"Beacon": {
"Authentication": {
"AdditionalPaths": [ "/warp", "/openapi" ]
}
}
}
Terminal window
Beacon__Authentication__AdditionalPaths__0=/warp
Beacon__Authentication__AdditionalPaths__1=/openapi

An invalid entry fails startup:

Beacon:Authentication:AdditionalPaths:1 must be a path prefix such as /warp: it starts with '/', is not '/' alone and has no query or fragment.

A successful password or single sign-on sign-in issues the Beacon.Auth cookie. Its fixed properties are HttpOnly = true, SameSite = Lax, and sliding expiration on. These are not configurable.

The Secure flag follows the request’s scheme by default (SameAsRequest). Behind a TLS-terminating proxy that means the flag is missing unless forwarded headers restore the https scheme. Set SecureAlways to issue the flag on every response.

KeyTypeDefaultRangeWhat it does
Beacon:Authentication:Cookie:SecureAlwaysboolfalse (filled true by the regulated profile when unset)true, falseAlways sets the Secure flag on the Beacon.Auth cookie. It covers that cookie only; the antiforgery and OIDC cookies keep their own policies.
Beacon:Authentication:Session:PersistSsoCookieboolfalsetrue, falsefalse: a single sign-on session cookie is dropped when the browser closes. true: it lives until its expiry, within AbsoluteLifetimeHours. Password sign-in follows the “remember me” box instead.

After startup, outside Development, Beacon logs one Warning when all of these hold: the server listens on a plain HTTP address, SecureAlways is off, and no forwarded scheme is configured. The text begins:

The server listens on plain HTTP outside Development, no forwarded scheme is configured and Beacon:Authentication:Cookie:SecureAlways is off: if Beacon is reached over plain HTTP, the Beacon.Auth session cookie is issued without the Secure flag ...

The warning is skipped when the host already honours X-Forwarded-Proto. The fix is either SecureAlways=true or UseForwardedHeaders with only your proxies trusted (see Rate limits and request limits).

{
"Beacon": {
"Authentication": {
"Cookie": { "SecureAlways": true }
}
}
}
Terminal window
Beacon__Authentication__Cookie__SecureAlways=true

Other cookie headers and the antiforgery cookie are on Browser protections.

A session cookie is only a claim. With Beacon user management on, Beacon checks it against the user store: the user must still exist, be enabled and not be archived, and the session must carry the user’s current security stamp. The session’s roles are replaced by the stored roles. A session that fails the check is signed out.

KeyTypeDefaultRangeWhat it does
Beacon:Authentication:Session:RevalidateMinutesint50 to 1440Longest time between checks against the user store. 0 checks every request.
Beacon:Authentication:Session:AbsoluteLifetimeHoursint121 to 8760A session ends this long after its sign-in, however often it is renewed. The user signs in again.

Values outside the ranges fail startup:

Beacon:Authentication:Session:RevalidateMinutes must be between 0 and 1440.
Beacon:Authentication:Session:AbsoluteLifetimeHours must be between 1 and 8760.

The realtime (SignalR) hub follows the same rule: a connection stays open for the revalidation interval (at least one minute), then the hub closes it and the client reconnects. A revoked or demoted user loses the connection as soon as the session would be checked again.

Two older settings still set the cookie’s own expiry for password sign-in (the absolute lifetime above caps both):

KeyTypeDefaultWhat it does
Authentication.CookieExpirationHours (code option)int24Cookie lifetime without “remember me”.
Authentication.RememberMeExpirationDays (code option)int30Cookie lifetime with “remember me”.

Each user has a security stamp. Changing it ends every session that carries the old one. The stamp is renewed by:

  • a sign out everywhere (the user’s own, or an administrator’s POST /beacon/api/users/{id}/sign-out-everywhere);
  • a change of a user’s roles (adding or removing a role), including an approved grant of the Admin role;
  • disabling or enabling a user, and archiving (deleting) a user;
  • a change of a user’s user name or e-mail address;
  • a password reset by an administrator;
  • a password change by the user, including the password a user chooses at their first sign-in after an administrator set one.

A change of the display name alone does not renew it. The sessions end within one revalidation interval at most.

A person ends their own other sessions with:

POST /beacon/api/auth/logout?everywhere=true
X-XSRF-TOKEN: <antiforgery token>

This renews the stamp first, then ends the current session. It also sets TokensValidAfter on the user, so a bearer token issued before that moment is refused (see JWT validation). If the caller is not a signed-in session of a stored user, nothing is signed out and the answer is 409 problem+json whose detail is Your user could not be found, so your sessions were not signed out everywhere. On a host without the mediator the detail is Signing out everywhere is not available on this host.

A plain POST /beacon/api/auth/logout ends only the current session and answers {"success":true}.

WhereNameMeaning
Log, event 7118 SessionEndedSession ended: {Reason} (user {UserId})Revalidation refused the session. A session naming no stored user logs Session ended: {Reason} (subject {SubjectHash}) at Warning.
Log, event 7117 UserSessionsRevokedEvery session of user {UserId} signed out, by user {ActorId}A sign out everywhere (logged at Information; other stamp renewals write no such event).
Audit actionauth.session_endedThe same refusal, with a reason code.
Audit actionauth.signed_out, auth.signed_out_everywhereAn explicit sign out.

POST /beacon/api/auth/login takes username, password, optional rememberMe, and optional newPassword.

POST /beacon/api/auth/login
Content-Type: application/json
X-XSRF-TOKEN: <antiforgery token>
{ "username": "alice", "password": "REPLACE_ME" }
ResultStatusBody
Signed in200{"success":true,"redirectUrl":"/beacon/home"}
Missing field400{"success":false,"error":"Username and password are required."}
Wrong password, unknown user, locked or delayed account, disabled user401{"success":false,"error":"Invalid username or password."}
An administrator set the password, and no newPassword was sent401{"success":false,"passwordChangeRequired":true,"error":"..."}; audit action auth.password_sign_in_refused with reason password_change_required
newPassword sent and refused by the password rules400{"success":false,"passwordChangeRequired":true,"error":"..."}
Over the per-address login limit429problem+json, see below
No valid antiforgery token400before the password is checked

The failure answer is the same for every cause on purpose. A locked or delayed account still has its password checked, and every refused attempt runs the same statements, so neither the answer nor its timing says whether a name exists or is locked.

The 429 answer, from the per-address login limit:

HTTP/1.1 429 Too Many Requests
Content-Type: application/problem+json
Retry-After: 42
{ "title": "Too Many Requests", "status": 429, "detail": "Too many requests; retry in 42 seconds." }

The body is shown with its Beacon-set fields; the framework may add its standard problem fields.

After repeated wrong passwords an internal user’s password sign-in and password change are refused for a while, whatever password is sent.

KeyTypeDefaultRangeWhat it does
Beacon:RateLimits:Lockout:EnabledbooltrueApplies the lockout.
Beacon:RateLimits:Lockout:MaxFailedAttemptsint50 to 100 (0 turns it off)Wrong passwords before a lockout.
Beacon:RateLimits:Lockout:DurationMinutesint151 to 1440How long the lockout lasts.

A successful sign-in, a lockout and an administrator’s password reset restart the count. So does a wrong password sent DurationMinutes or more after the previous one. The count is stored on the user, not on the client. That caps password guessing hard, and it means anyone who knows a user name can keep that user’s password sign-in locked. Hosts that prefer the opposite rely on single sign-on and the per-address login limit and turn the lockout off.

Log event 7124 UserLockedOut (Warning): User {UserId} refused password sign-in for {LockoutSeconds} seconds after {FailedAttempts} wrong passwords (break-glass delay: {BreakGlassDelay}); audit action auth.user_locked_out. The same event is logged when a break-glass delay begins.

KeyTypeDefaultRangeWhat it does
Beacon:UserManagement:MinimumPasswordLengthint81 to 128Raises the minimum length. The larger of this and the length set in code applies. The regulated profile fills 12 when unset.
UserManagementOptions.RequirePasswordComplexity (code option)booltrueRequires the complexity rules.

A value outside 1 to 128 fails startup: Beacon:UserManagement:MinimumPasswordLength must be between 1 and 128.

A new password must differ from the current one: The new password must differ from the current one. When an administrator sets a password, the user must choose their own on the next sign-in, in the same request (newPassword), and it must differ from the one the administrator set.

Passwords are stored as PBKDF2-SHA256 with the iteration count in the hash (v2$<iterations>$<base64>). The current count is 600,000. A weaker stored hash is replaced only after a successful sign-in, by a write that checks the hash it verified, so it never undoes a concurrent password change.

With single sign-on, people should sign in through the identity provider so its multi-factor authentication and conditional access apply. Turn local login off, and keep at most three emergency accounts that may still use a password.

KeyTypeDefaultRangeWhat it does
Beacon:UserManagement:LocalLogin:Enabledbooltruefalse: POST /beacon/api/auth/login is not mapped, Beacon’s password providers refuse every account, and the login page shows no password form, except for break-glass names.
Beacon:UserManagement:LocalLogin:BreakGlassUserNameslist of stringsemptyat most 3; no blank entryInternal accounts that may sign in with a password while local login is off. Compared exactly, case included, with the stored user name.

The endpoint stays mapped while at least one break-glass name is configured. Every name gets the same password check, and the decision comes after it, so neither the answer nor its timing tells a break-glass account from any other.

{
"Beacon": {
"UserManagement": {
"LocalLogin": {
"Enabled": false,
"BreakGlassUserNames": [ "emergency-admin" ]
}
}
}
}
Terminal window
Beacon__UserManagement__LocalLogin__Enabled=false
Beacon__UserManagement__LocalLogin__BreakGlassUserNames__0=emergency-admin

Startup failures:

Beacon:UserManagement:LocalLogin:BreakGlassUserNames may not contain a blank entry.
Beacon:UserManagement:LocalLogin:BreakGlassUserNames lists 4 accounts; at most 3 are allowed: break-glass accounts are for emergencies only.
InputAnswerLogAudit
Right password, name on the list200Warning 7119 BreakGlassSignIn: Break-glass password sign-in while local login is off (user {UserId})auth.break_glass_signed_in
Right password, name not on the list401 Invalid username or password.Information 7120 PasswordSignInRefused: Password sign-in refused: local login is off and the account is not a break-glass account (a provider that finds the account itself logs ... and user {UserId} is not a break-glass account)auth.password_sign_in_refused
Wrong password401 Invalid username or password.none of the aboveauth.password_sign_in_failed

The typed user name is never logged. Alert on event 7119: nobody should use a break-glass account in normal operation.

Break-glass accounts are never locked. Instead, an optional growing delay can be switched on. It is off by default, because anyone who knows a break-glass name could otherwise keep that account delayed. Off, only the per-address login limit applies.

KeyTypeDefaultRangeWhat it does
Beacon:RateLimits:BreakGlassThrottle:EnabledboolfalseApplies the delay.
...:FailedAttemptsBeforeDelayint50 to 100Wrong passwords before the first delay.
...:InitialDelaySecondsint301 to MaxDelaySecondsFirst delay; doubles after each further wrong password sent once a delay ended.
...:MaxDelaySecondsint3001 to 3600Longest delay.
...:ResetAfterMinutesint601 to 1440, and longer than MaxDelaySecondsA wrong password this long after the previous one restarts the count.

Wrong passwords sent during a delay are not counted and do not lengthen it, so a delay always ends and the right password then signs in. The answer during a delay is the same generic 401.

Single sign-on is off by default. Turn it on with an authority, a client and a client secret, and tell Beacon which sign-ins to admit.

KeyTypeDefaultWhat it does
Beacon:Authentication:Oidc:EnabledboolfalseTurns single sign-on on.
...:AuthoritystringnoneIssuer URL of the identity provider. Required when enabled.
...:ClientIdstringnoneRequired when enabled.
...:ClientSecretstringnoneRequired when enabled. Keep it in a secret store.
...:CallbackPathstring/signin-oidcWhere the provider returns the browser.
...:Scopeslistopenid, profile, emailRequested scopes.
...:DefaultRoleNamestringunsetRole for a user provisioned at first sign-in. Unset: the user signs in with no role and sees nothing until an administrator assigns one.
...:DisplayNamestringSSOLabel on the login button.
...:McpJwksEndpointstringunsetOptional JWKS endpoint of the provider; with single sign-on enabled and this set, Beacon’s API and /beacon/mcp also accept bearer JWTs from the provider (issuer Authority, audience ClientId).
...:AllowedTenantslistemptyEntra tenant ids (tid claim) that may sign in.
...:AllowAnyTenantboolfalseSkips the tenant check, for providers that issue no tid claim.
...:BlockGuestsbooltrueRefuses Entra B2B guests (acct claim 1, or an idp claim naming another provider).
...:RequiredGroupslistemptyGroup object ids (groups claim).
...:RequiredRoleslistemptyApp roles (roles claim). When either list is set, the user must hold at least one entry of either.
...:RequireMfaboolfalseThe ID token’s amr must contain mfa, or its acr must be one of AcceptedAcrValues.
...:AcceptedAcrValueslistemptyExact acr values that count as multi-factor.
...:EnableFrontChannelLogoutboolfalseServes /signout-oidc. Off, because an anonymous GET there would end a Beacon session.

Enabling single sign-on without a tenant rule fails startup:

Beacon:Authentication:Oidc is Enabled but admits every tenant: set AllowedTenants to your tenant id(s), or set AllowAnyTenant to true when your identity provider issues no tenant (tid) claim.
Beacon:Authentication:Oidc is Enabled but Authority, ClientId, or ClientSecret is missing.

An example for an Entra tenant that requires multi-factor sign-in and one group:

{
"Beacon": {
"Authentication": {
"Oidc": {
"Enabled": true,
"Authority": "https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000/v2.0",
"ClientId": "11111111-1111-1111-1111-111111111111",
"ClientSecret": "REPLACE_ME",
"AllowedTenants": [ "00000000-0000-0000-0000-000000000000" ],
"BlockGuests": true,
"RequiredGroups": [ "22222222-2222-2222-2222-222222222222" ],
"RequireMfa": true
}
}
}
}
Terminal window
Beacon__Authentication__Oidc__Enabled=true
Beacon__Authentication__Oidc__ClientSecret=REPLACE_ME

Beacon sends the browser to the login page with a code in the query string. The page shows a message for each.

CauseRedirectAudit
Not admitted: wrong tenant, guest, missing group or role, a disabled or archived account, first-run setup not finished, or (under Beacon:Audit:Required) the sign-in event could not be written/beacon/login?ssoError=not_admittedauth.sso_refused
RequireMfa is on and the token has neither amr mfa nor an accepted acr/beacon/login?ssoError=mfa_requiredauth.sso_refused
Any other provider failure/beacon/login?ssoError=1, with a Warning OIDC remote failure (...)none

A successful sign-in records auth.sso_signed_in.

What RequireMfa covers: the interactive single sign-on sign-in only. Do not describe bearer tokens, MCP access, API keys or break-glass sign-in as protected by it. Check what your provider puts in the ID token before turning it on: a provider that sends neither amr nor acr locks everyone out.

A host can accept bearer tokens (Authorization: Bearer <jwt>) from an identity provider, and can call an external login endpoint. Beacon validates the token itself. Startup fails unless a signing key or JWKS endpoint, at least one issuer and one audience are set and issuer, audience and lifetime validation are on, because a shared JWKS (Entra’s, for one) signs tokens for every tenant and application.

KeyTypeDefaultRangeWhat it does
Beacon:Authentication:Jwt:EnableBearerAuthenticationboolfalseAccepts bearer tokens.
...:ExternalLoginEndpointURLnoneabsolute httpsLogin form calls this endpoint and receives a JWT.
...:AccessTokenClaimstringnonenot a claim an ID token can carryFor non-Entra issuers that do not set typ: at+jwt: a claim present only in access tokens.
...:Validation:ValidIssuer, ValidIssuersstring, listnoneat least oneAccepted iss values.
...:Validation:ValidAudience, ValidAudiencesstring, listnoneat least oneAccepted aud values.
...:Validation:SigningKeystringnoneat least 32 UTF-8 bytesHMAC secret.
...:Validation:JwksEndpointURLnoneabsolute httpsSigning keys of the provider.
...:Validation:ClockSkewtime span00:05:000 to 5 minutesTolerance on token times.
...:Validation:JwksRefreshIntervaltime span01:00:005 minutes to 24 hoursHow often the JWKS is fetched again.
...:Validation:JwksMaximumStalenesstime span24:00:00JwksRefreshInterval to 7 daysHow long keys stay usable while the endpoint fails.
...:Validation:ValidateIssuer, ValidateAudience, ValidateLifetimebooltruemust stay trueValidation switches.

Plain http is accepted only for a loopback host, and the host refuses even that at startup outside Development.

A token issued before the user’s last sign out everywhere is refused: its iat is compared with TokensValidAfter, and a token with no readable iat counts as issued before. The refusal is IssuedBeforeSignOut and applies on the REST routes and on /beacon/mcp (the MCP caller mapper caches TokensValidAfter for up to a minute).

{
"Beacon": {
"Authentication": {
"Jwt": {
"EnableBearerAuthentication": true,
"Validation": {
"ValidIssuer": "https://login.example.com/",
"ValidAudience": "beacon-api",
"JwksEndpoint": "https://login.example.com/.well-known/jwks.json",
"JwksRefreshInterval": "01:00:00",
"JwksMaximumStaleness": "24:00:00"
}
}
}
}
}

POST /beacon/api/auth/login and POST /beacon/api/auth/logout need an antiforgery token, anonymous callers included. Without one, a cross-site form post could sign a browser in to another account, or delete its cookie. The request is refused with 400 before the rate limit or the password check. Prime a token with GET /beacon/api/csrf and send it as X-XSRF-TOKEN. After a sign-in or sign-out Beacon issues a fresh token for the new identity. Details are on Browser protections.

While no super admin exists, the setup page needs a token. Beacon uses, in order, the token set in code, then Beacon:UserManagement:SetupToken, then a token generated for that process and written once to the console (standard error).

KeyTypeDefaultRangeWhat it does
Beacon:UserManagement:SetupTokenstringunsetat least 32 characters when setSecret the setup page requires.

While setup is open, Beacon logs First-run setup is open: no super admin exists yet. Setup requests have their own per-address limit with the same size as login, in a separate partition. A wrong or missing token is refused with 403 problem+json whose detail is The setup token is missing or invalid. Use the token from the server console or the configured Beacon:UserManagement:SetupToken., logged as the Warning First-run setup rejected: the setup token is missing or invalid., and recorded as auth.setup_token_refused (whether a token was sent, never its value).

Every sign-in outcome is an event in the security audit trail. See Security audit trail for the trail itself.

ActionWhen
auth.password_sign_in_succeededPassword sign-in worked.
auth.password_sign_in_failedWrong password or unknown name.
auth.password_sign_in_refusedCorrect password, but local login is off and the account is not break-glass.
auth.break_glass_signed_inA break-glass sign-in.
auth.sso_signed_in, auth.sso_refusedSingle sign-on outcomes.
auth.signed_out, auth.signed_out_everywhere, auth.session_endedSessions ending.
auth.user_locked_outA lockout began.
auth.setup_token_refusedA wrong or missing first-run setup token.

Events carry ids, counts and codes only. They never carry a typed user name, an address or a password.

Beacon:Audit:Required (default false) makes the trail mandatory for sign-in. On, a successful sign-in whose event cannot be written is refused: the session just issued is withdrawn, the answer is the generic 401 and Beacon logs Error 9115 SecurityAuditRequiredEventNotWritten (after the 9107 SecurityAuditWriteFailed copy of the event). A required password change that was already saved answers Your new password is saved, but you could not be signed in. Sign in with your new password. A break-glass sign-in is exempt, so an audit outage cannot lock out the emergency way in: it is admitted without its event and Beacon logs Error 9116 SecurityAuditExemptEventNotWritten.

SettingDevelopmentProductionRegulated profile
LocalLogin:Enabledtruefalse once single sign-on worksmust be false
LocalLogin:BreakGlassUserNamesemptyone name, password in a vaultone name
Oidc:AllowedTenantsyour test tenantyour tenantyour tenant
Oidc:BlockGueststruetruetrue
Oidc:RequireMfafalsetrue if the provider sends amr or acrmust be true when single sign-on is on
Cookie:SecureAlwaysfalsetruefilled true when unset
Session:RevalidateMinutes55not constrained
Session:AbsoluteLifetimeHours128 to 12not constrained
RateLimits:Lockoutononmust be on (Enabled true, MaxFailedAttempts above 0)
MinimumPasswordLength812filled 12 when unset; below 12 fails startup
Audit:Requiredfalsetruefilled true when unset
BreakGlassThrottle:Enabledfalsefalsenot constrained

The regulated profile (Beacon:Profile = Regulated) fills only keys you leave unset, and never overrides a value you configured. It fills Beacon:Audit:Required, Beacon:Authentication:Cookie:SecureAlways and Beacon:UserManagement:MinimumPasswordLength. It fails startup, listing every problem in one message, when local login is on, when single sign-on is on without RequireMfa, or when the lockout is off.

SymptomCauseFix
Startup fails with “admits every tenant”Single sign-on enabled with no tenant ruleSet AllowedTenants, or AllowAnyTenant if the provider issues no tid.
Everyone lands on ?ssoError=mfa_requiredThe ID token has no amr mfa and no accepted acrAdd the provider’s acr value to AcceptedAcrValues, or fix the provider’s policy.
?ssoError=not_admitted for a known personWrong tenant, guest account, missing group or role, or the user is disabled or archivedCheck AllowedTenants, RequiredGroups, RequiredRoles and the user’s state.
Password sign-in answers 401 for a correct passwordLocal login is off and the name is not break-glass, the account is locked or delayed, or the user is disabledLook for event 7120. Wait out the lockout, or reset the password.
400 on login or logoutNo antiforgery tokenPrime GET /beacon/api/csrf and send X-XSRF-TOKEN.
429 on loginPer-address limitWait Retry-After seconds. Behind a proxy, enable forwarded headers so the limit is per client.
Session ends sooner than expectedAbsolute lifetime, a renewed security stamp, or a disabled userCheck AbsoluteLifetimeHours and events 7117 and 7118.
Sign-in refused while Audit:Required is onThe audit event could not be writtenFix the audit store; look for events 9107 and 9115.
Browser shows the cookie without SecurePlain HTTP behind a proxySet SecureAlways or enable forwarded headers.
Startup fails on a JWT settingA missing issuer, audience or key, or a value out of rangeRead the message; it names the setting.
Bearer token refused after sign out everywhereIts iat is before TokensValidAfterGet a new token.