mirror of
https://github.com/urbit/shrub.git
synced 2024-12-21 01:41:37 +03:00
8579b6c952
aka "mirage" aka "eyre oauth" With Eyre now supporting both local identity authentication, and fake guest identities, the logical next step is to support authentication with real non-local identities. Here, we implement that, building on top of the groundwork laid by #6561. The primary change is adding a %real case to Eyre's $identity type, and implementing an http<->ames<->ames handshaking protocol into Eyre for negotiating approval of login attempts made by unauthenticated HTTP clients. The authentication flow, where a "visitor" logs into a "~host" as their own "~client" identity can be described in brief as follows: 1) Visitor makes an HTTP request saying they are ~client. 2) ~host tells ~client, over Ames, about its own public-facing hostname. 3) ~client responds with its own public-facing hostname. 4) ~host forwards the visitor to ~client's eauth page. 5) Visitor, there already logged in as ~client, approves the login attempt. 6) ~client shares a secret with ~host over Ames, and forwards the visitor to ~host's eauth page, including the secret in the request. 7) ~host sees that the secrets received over Ames and HTTP match, and gives the visitor a new session token, identifying them as ~client. The negotiating of hostnames/URLs via Ames is crucial to keeping this handshake sequence secure. Discovering a ship's public-facing hostname happens when successful local logins are made by reading out the Host header from the request. Users may hard-code a value to override this. Each eauth login attempt comes with a unique nonce. Both the host and client track the lifetime of these. The corresponding Ames flow (which goes from ~host -> ~client) is corked when the login attempt gets aborted, or its associated session expires. The logout functionality has been updated to let clients ask to be logged out of sessions on other ships. |
||
---|---|---|
.. | ||
vane | ||
arvo.hoon | ||
hoon.hoon | ||
lull.hoon | ||
zuse.hoon |