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.
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.
| Endpoint | Purpose |
|---|---|
GET /.well-known/openid-configuration | Provider metadata |
GET /oauth2/jwks | Public signing keys |
GET /oauth2/authorize | Authorization request |
POST /oauth2/authorize/approve | Explicit consent |
POST /oauth2/token | Authorization-code exchange |
GET /oauth2/userinfo | User 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.
{
"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.
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.
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>
{
"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
GET /oauth2/userinfo HTTP/1.1
Host: localhost:8443
Authorization: Bearer <access-token>
{
"sub": "<pairwise-subject>",
"name": "Ada",
"email": "ada@example.invalid",
"email_verified": true
}
| Claim | Scope | Notes |
|---|---|---|
sub | openid | Pairwise subject; stable for this client, not global across clients |
name | profile | Display name when available |
email | email | Email when available |
email_verified | email | Whether the account marked the address verified |
auth_time | openid | ID token claim for the authentication time |
nonce | openid | Echoed into the ID token for replay protection |
Protocol errors
| Error | Meaning |
|---|---|
invalid_request | Missing or malformed parameter |
invalid_client | Unknown client or failed client authentication |
invalid_grant | Bad, expired or already-used authorization code; wrong redirect or verifier |
unsupported_response_type | Only code is supported |
invalid_scope | A scope the client is not allowed to request |
access_denied | The 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
- Secrets and storage — encryption and delivery.
- Hosting and bridge — launch authority.
- API reference — OIDC and session routes.
Was this page helpful?