Browser login errors and recovery

Ipseity sends browser sign-in failures back to a login box with a readable error and a way to retry. Applications and API callers continue to receive JSON errors with the original HTTP status.

Response selection

Recovery applies to errors from GET/POST /oauth/authorize, POST /oauth/authorize/consent, GET /oauth/extlogin/callback, GET /oidc/logout, GET /oidc/userinfo, GET /oidc/verify-email and the token, introspection and revocation endpoints when the request advertises Accept: text/html or Sec-Fetch-Mode: navigate. Normal browser page navigations and HTML form submissions send these headers.

Accept: application/json or X-Requested-With: XMLHttpRequest always selects the programmatic response instead. Requests without browser navigation headers retain their existing error responses. Token, introspection and revocation calls made through the console or an API client retain their JSON protocol; only their errors requested as browser pages redirect to login. REST API endpoints always retain their JSON protocol. An intentional consent denial still sends the standard OAuth access_denied response to the validated client callback.

Browser errors use 303 See Other, so a failed password or consent POST becomes a GET of the login screen. The error is inside the styled login card with role="alert". A Back to sign in link also opens the current realm's console. The redirect and authorization login page use Cache-Control: no-store; the redirect and login document suppress referrers to avoid passing the request query to a theme stylesheet's server.

Messages

Failure Login message / action
Unknown username or wrong password Bad username or password.
Invalid email-verification link Sign in and request a new verification email.
Wrong MFA code Enter a new MFA code and try again.
Account lockout Wait for the temporary lockout to end.
Rate limit Wait before trying again.
Expired or invalid consent / external-login state Sign in again with the recovered request.
Unknown application Return to the application and start sign-in again.
Unregistered return URL Contact the application administrator.
Disallowed scope Contact the application administrator.
Disabled or banned account Contact the account administrator.
External-provider rejection or transport failure Try again or use another sign-in method.
Backend/provider exception or malformed request A general temporary-unavailability or invalid-request message.

The retry URL carries a fixed login_error code. Only server-defined messages are displayed; arbitrary error text in the URL is ignored. Password submission for an unknown managed console client retains the generic credential failure to avoid changing the console's realm-privacy behavior.

Authorization context

A failed authorization request reconstructs a local /oauth/authorize URL with these fields, and the login form carries them into the next attempt:

  • response_type, client_id, redirect_uri and scope;
  • the application's state and OIDC nonce;
  • code_challenge and code_challenge_method;
  • the client theme, subject to the normal stylesheet URL validation.

Omitted POST defaults are made explicit (response_type=code, scope=openid, code_challenge_method=S256). Provided values, including empty values, are preserved. Invalid or unknown client theme URLs are not applied or carried in the rendered form. Provider buttons preserve the validated theme as well.

Passwords, usernames, MFA codes, client secrets, bearer/refresh/ID tokens, authorization codes, PKCE verifiers and arbitrary extra fields never enter a recovery URL or record. Provider callback state is an Ipseity lookup token; it is never substituted for the application's original OAuth state. external_provider is omitted from recovery URLs so a failed provider does not immediately restart when the login page loads. Users can choose that provider again or use their local password.

Rendering a retry form can tolerate an invalid client, scope, response type or return URL, which prevents a redirect loop. Rendering cannot authenticate a principal or issue a code. A password retry rechecks the client/realm, redirect rules, scope, PKCE requirements, credentials, lockout, MFA and login permission. External-provider and consent completions retain their existing validations. An invalid redirect is only displayed as an escaped hidden input; the browser is never sent there on a failed request. Theming remains restricted to URLs allowed by the registered client.

The short-lived consent/provider record is insufficient to reconstruct a request after expiry. When creating either flow, Ipseity also saves a recovery-only KV record in the issuing realm:

  • login-recovery:consent:<random-token>;
  • login-recovery:extlogin:<random-token>.

These records contain only the authorization fields above. Their TTL is the larger of 24 hours and the associated flow TTL plus one hour. The original consent/provider state expires and remains single-use as before. A recovery record cannot approve consent, validate a provider callback, authenticate a user or issue tokens; it only supplies a fresh login form. It stays available until its TTL, including after successful completion, so an expired or repeated callback can still recover the original request. Normal KV TTL cleanup applies.

With Kubernetes storage these are encrypted KV ConfigMaps shared by replicas; in-memory development storage retains them only in that process. See Kubernetes state resources.

If both records have expired, the callback token is unknown, or no client ID is available, Ipseity cannot recover the application's request. It opens the known realm's console login with the error instead (the default realm when no realm can be determined). That console can start a fresh, complete PKCE login. To resume the original external application after this fallback, start sign-in again from that application. A token-endpoint browser request may supply only a client and scope, without the state/nonce/PKCE inputs of its original login; those known inputs are retained, but a complete application sign-in must still be restarted from that application.

Console behavior

The console's in-page login translates invalid credentials to Bad username or password. Failures exchanging an authorization code, validating callback state, matching the console client, or restoring a stored session all show the login screen with the error inside its login box. A 401 from an authenticated API request clears the local session and opens the same login screen with Session expired. Sign in again. Password and MFA inputs are cleared when returning to login.

Failed OAuth callbacks are removed from the address bar so refresh does not replay a spent code. The console retains its own realm/client configuration and requested scopes; a new sign-in generates fresh state, nonce and PKCE values. The server's fallback console URL carries only the fixed error code, which the console renders from its server-provided context and then removes from the URL.