Skip to main content
Version: 0.15.0

Signing in

On a channel whose peer the kernel cannot identify, a caller is established by the host's own authentication service, once, and carries the answer as a session token. Yoke stores no password, hashes none, keeps no list of users and creates no account. This page gives how the host is asked through yoke-auth, the session token, how each projection carries it, and a browser signing in from end to end.

WhereHow the caller is established
an administrative surface, and an interface channel on a local socketthe kernel's peer credential, resolved to an account by the host; nothing is asked of the person
an interface channel on a routable addressan account name and a secret, put by the Core to the host's authentication service

The host's answer​

On the reference host the service is PAM, under the service name yoke. A site that wants a stack of its own writes /etc/pam.d/yoke; otherwise the host's other stack decides.

The Core asks through yoke-auth, executed once per authentication. The Core is statically linked and opens no library; yoke-auth opens the host's authentication library at run time, so a host without it loses authentication and nothing else.

wherebeside the Core's executable — /usr/bin/yoke-auth in the service form
what it is givenon standard input: the account name, a zero byte, the secret. Nothing on its command line or in its environment
what it asksthe service yoke: the authentication step, then the account step
what it answersits exit status alone: 0 accepted, 1 refused, 2 the service could not be asked
how longat most 30s; then it is killed and the attempt counts as one that could not be asked
with what privilegesthe Core's own
--probe0 where the service can be asked, 2 otherwise, asking nothing

The caller hears auth.invalid whether the answer was 1 or 2, and nothing about why. The Core's own log names a 2 as a fault, which is an operator's problem. Which accounts a host will answer for is the host's policy.

The session token​

what it is32 bytes from the host's random source, as base64url: opaque, with nothing to parse
where it is keptin the Core's memory, against one account and the one channel that issued it
how long12h from issue, and never past the life of the Core that issued it
what ends it earlythe Core stopping, the channel being unbound, the same account signing in again
where it is acceptedon the channel that issued it, and no other

Nothing about a session is persisted. A Core that restarts has ended every session it held.

In the browser projection​

POST /v1/authenticate {"version": 1, "authenticate": {"password": {"account": "alice", "secret": "…"}}}
→ 200 Set-Cookie: yoke-session=…; Path=/v1; HttpOnly; SameSite=Strict; Secure
{"authenticate": {"account": "alice", "expires": "…"}}
GET /v1/events (upgraded, with the cookie)
→ the opening picture
  • Signing in comes before attaching. /v1/events refuses auth.required until the request carries the cookie, and auth.invalid when the cookie holds a token never issued, expired or issued elsewhere.
  • The token is never in a body. The answer names the account and the expiry; the token travels only in yoke-session, which the page cannot read.
  • The cookie is Secure, so a browser keeps it only from a page served over HTTPS — which is how the page and the channel share one origin.

In the typed projection​

The first frame of an attachment is an authenticate request, carrying either the password or a token issued earlier on that channel. Once the host accepts it the opening picture arrives, then the answer: for a password it names the account, the token and its expiry. An attachment whose first frame is anything else, or whose credential is refused, is refused with auth.required or auth.invalid, and channel.attached names the account it was established as.

A browser, end to end​

  1. The client completes a TLS 1.3 handshake with ALPN http/1.1, and verifies the Core's certificate against what whoever provisioned both ends arranged.
  2. POST /v1/authenticate with an account and a secret. The Core asks the host, and sets the cookie.
  3. GET /v1/events, upgraded, with the cookie. The opening picture arrives.
  4. POST /v1/command. Whether the unit's Plugin was granted that command is decided when the unit is named: a command not granted is refused scope.withheld, 403, whatever the first two steps established.