Forth SDK
The Forth account client is in forth/auth.f in mesgd-sdk. Use it to enroll an account, obtain a session, and manage public keys independently of the PKI layer. The examples use an existing account named alice; passwords and authenticator codes come from the application rather than literals in source.
Support status
| Capability | Current support |
|---|---|
| Account operations | Available: signup, confirmation, login, reset, keys, key updates, and logout |
| HTTPS | Pending built-in transport; the application must supply verified HTTPS |
| WSS | Not implemented; the Forth sample is local cryptography only |
The account adapter is available, but a built-in HTTPS transport is still pending. The transport argument in the examples is application code, not a missing SDK constructor.
Completeness position: 18 of 18. Low-level account endpoint words and local cryptography; structured validation, JWK, HTTPS, and WSS remain unimplemented. The language matrix explains the ranking criteria and comparable tiers. WSS readiness is listed separately; no SDK currently provides a complete, validated encrypted messaging workflow against this server.
Setup and transport
Include auth.f in an application that supplies JSON construction, response parsing, and HTTPS. Unlike the structured clients, this adapter accepts complete JSON strings and does not validate their fields. The separate Forth sample demonstrates local cryptography rather than a WebSocket connection.
Install a transport execution token using ' my-https-transport is mesgd-auth-transport. Its stack effect is ( json-a json-u token-a token-u method-a method-u path-a path-u -- response-a response-u http-status ). Inputs are borrowed during the call; the application defines response-buffer ownership.
A custom transport must serialize JSON, attach Authorization: Bearer TOKEN only when a token is supplied, verify the certificate and hostname, reject redirects, and use a finite timeout. Its origin is an HTTPS URL, such as https://mesgd.example.com, rather than a WebSocket URL.
Log in, read keys, and log out
Pass the current authenticator code as a six-digit string, preserving leading zeroes. This example reads the account's published keys and ends the session on its successful path. Applications that retain a session can keep the bearer until logout or expiry instead.
include auth.f
\ my-https-transport must already implement the documented stack contract.
' my-https-transport is mesgd-auth-transport
\ login-json-a/login-json-u identify a JSON object containing user,
\ password, and otp. Obtain these values from the application.
login-json-a login-json-u auth-login
\ Stack: response-a response-u http-status
\ Check the status, parse access_token, and retain it before releasing the response.
token-a token-u auth-keys
\ Check the response before the next call reuses its buffer.
token-a token-u auth-logout
Words return the response address, response length, and status without checking for success. Check the HTTP status before parsing or acting on a result. JSON must quote the six-digit OTP and exclude private JWK fields. The Forth PKI sample is outside the shared JWK tests and supplies no WebSocket transport.
Enroll a new account
The following fragment uses an existing client or transport from the example above. Signup returns a pending enrollment. Display qr_png_base64 or otpauth_uri, let the person configure the authenticator, then collect a code to confirm it. These calls are separate application steps, with user interaction between them.
\ signup-json contains user, email, password, and public_keys as an array.
signup-json-a signup-json-u auth-signup
\ Display enrollment and collect an authenticator code.
\ confirm-json contains user, enrollment_token, and otp as a quoted string.
confirm-json-a confirm-json-u auth-confirm
\ Parse and display recovery_codes from a successful response.
Confirmation returns the first session and eight recovery codes. Display the recovery codes for separate safekeeping. A code accepted for confirmation cannot be reused for login or a key update; wait for a new authenticator step before another operation that consumes a code.
Account operations
| Operation | Function or method | HTTP endpoint |
|---|---|---|
| Create a pending account | auth-signup | POST /auth/signup |
| Confirm authenticator enrollment | auth-confirm | POST /auth/signup/confirm |
| Log in | auth-login | POST /auth/login |
| Reset a forgotten password | auth-reset-password | POST /auth/password/reset |
| Read account public keys | auth-keys | GET /auth/keys |
| Replace account public keys | auth-set-keys | PUT /auth/keys |
| End the current session | auth-logout | POST /auth/logout |
A key update takes the session token, current password, a fresh authenticator code, and an array containing only public JWKs. An empty array clears the linked keys. A password reset takes the username, a saved recovery code, a new password, and a fresh authenticator code; success replaces the recovery codes and revokes existing sessions without returning a new session.
The shared authentication reference documents argument order, response fields, and transport behavior. Session refresh is available through the HTTP API but is not wrapped by these seven SDK operations.
Message connections
Account login does not establish a message connection. The current server accepts JSON WebSocket frames and can authenticate an upgrade with a login session or an issued grant token. Login sessions carry identity without path restrictions; grants limit routing to assigned patterns. See WebSocket and Routing.
The encrypted registration handshake in the ping/pong samples is not implemented by the current mesgd listener. Treat those samples as experimental cryptographic examples, with compatibility limits described in Samples.
Validation
This account module is not included in the shared auth contract runner. Check it with the application's own toolchain and transport before deployment. The presence of source examples does not imply that live HTTPS or cross-language cryptographic behavior has been validated for this implementation. Languages lists the repository's current test coverage.