Platform · identity

Local accounts. Standards-based identity.

rumahl OS owns local accounts and acts as its own OpenID Provider. Installed applications can authenticate through a live local session without turning rumahl into a cloud account provider.

12 min readUpdated 24 November 2026OAuth 2.0 · OpenID Connect

Local accounts

rumahl supports multiple local user accounts. Account selection and session state are explicit: changing the active desktop account must not silently change an existing app or OAuth session.

  • A local password login issues a fresh 12-hour __Host- session cookie.
  • Credentials and sessions are stored in SQLite and survive server restarts.
  • There is no public account-registration endpoint and no universal default password.
  • Development credentials are generated into the local state directory, never embedded in source.

The OpenID Provider

rumahl OS is a standards-compliant OpenID Provider for installed applications. Protocol DTOs, tokens and signing keys stay outside the domain core; the account and consent decisions remain local.

EndpointPurpose
GET /.well-known/openid-configurationProvider metadata
GET /oauth2/jwksPublic signing keys
GET /oauth2/authorizeAuthorization request
POST /oauth2/authorize/approveExplicit consent
POST /oauth2/tokenAuthorization-code exchange
GET /oauth2/userinfoUser information for authorized clients

The discovery document advertises Authorization Code only, PKCE S256, pairwise subjects, EdDSA ID tokens and the openid, profile and email scopes. There is no implicit flow, password grant or refresh-token grant in the current provider.

discovery (shape)
{
  "issuer": "https://localhost:8443",
  "authorization_endpoint": "https://localhost:8443/oauth2/authorize",
  "token_endpoint": "https://localhost:8443/oauth2/token",
  "userinfo_endpoint": "https://localhost:8443/oauth2/userinfo",
  "jwks_uri": "https://localhost:8443/oauth2/jwks",
  "response_types_supported": ["code"],
  "grant_types_supported": ["authorization_code"],
  "subject_types_supported": ["pairwise"],
  "id_token_signing_alg_values_supported": ["EdDSA"],
  "code_challenge_methods_supported": ["S256"],
  "token_endpoint_auth_methods_supported": ["client_secret_basic", "none"],
  "scopes_supported": ["openid", "profile", "email"]
}

Authorization Code + PKCE

Generate a high-entropy verifier, send its SHA-256 challenge, then present the verifier at the token endpoint. Never put a client secret or a token in a URL.

authorization request
GET /oauth2/authorize?
  response_type=code&
  client_id=com.example.notes&
  redirect_uri=https%3A%2F%2Fnotes.example%2Fcallback&
  scope=openid%20profile&
  state=<random-state>&
  nonce=<random-nonce>&
  code_challenge=<BASE64URL(SHA256(verifier))>&
  code_challenge_method=S256 HTTP/1.1
Host: localhost:8443

The provider shows a local consent page. The user approves or denies the requested scopes for the live local account and session. Approval is a same-origin form post, not a JSON API.

token exchange
POST /oauth2/token HTTP/1.1
Host: localhost:8443
Content-Type: application/x-www-form-urlencoded

grant_type=authorization_code&
code=<authorization-code>&
redirect_uri=https%3A%2F%2Fnotes.example%2Fcallback&
client_id=com.example.notes&
code_verifier=<original-verifier>
token response
{
  "access_token": "…",
  "id_token": "…",
  "token_type": "Bearer",
  "expires_in": 900,
  "scope": "openid profile"
}

Access tokens and ID tokens expire after 15 minutes. The current provider does not issue refresh tokens; re-run the authorization flow when a token expires. The id_token is signed with EdDSA and uses a pairwise subject per client.

UserInfo and claims

userinfo request
GET /oauth2/userinfo HTTP/1.1
Host: localhost:8443
Authorization: Bearer <access-token>
userinfo response (shape)
{
  "sub": "<pairwise-subject>",
  "name": "Ada",
  "email": "ada@example.invalid",
  "email_verified": true
}
ClaimScopeNotes
subopenidPairwise subject; stable for this client, not global across clients
nameprofileDisplay name when available
emailemailEmail when available
email_verifiedemailWhether the account marked the address verified
auth_timeopenidID token claim for the authentication time
nonceopenidEchoed into the ID token for replay protection

Protocol errors

ErrorMeaning
invalid_requestMissing or malformed parameter
invalid_clientUnknown client or failed client authentication
invalid_grantBad, expired or already-used authorization code; wrong redirect or verifier
unsupported_response_typeOnly code is supported
invalid_scopeA scope the client is not allowed to request
access_deniedThe user denied consent

Flow rules

  • Use Authorization Code with PKCE for installed applications.
  • No resource-owner password grant, implicit flow or refresh-token grant is exposed.
  • Consent is explicit and revocable. A new scope is a new decision.
  • Uninstalling an app revokes its authorization codes, consents, access tokens and client registration.
  • Local accounts and OIDC sessions are separate from the website account or GitHub account.

Sessions and revocation

A session is a live authorization input, not a permanent identity. Rust revalidates the live account, session, installation and grants at launch and on renewal. An explicit grant for a removed installation cannot authorize its replacement.

The shell should fail closed on a revoked session: close the frame, clear private in-memory state and offer a new login. Do not replay a stale lease or reuse a cached private response.

Next