spec server-initiated sign-in with ssb #18
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@keks @cryptix Would appreciate your feedback! 🙏
Context: I met cryptix and we figured that Sign-in with SSB has a missing feature.
Problem: The spec was assuming that the dance is initiated by the client SSB peer which generates a challenge and then opens a page in the browser, but there are often cases where you'd like to begin with the browser, such as inputting your SSB ID or alias. The spec didn't account for that and assumed that we always had to begin it in the client SSB peer.
Other problem as I digged deeper: if we want both sides (server and client) to verify each other's solutions, we need to send messages 3 times (A-->B generates challenge, B-->A sends solution, A-->B sends solution), and this can't be done with 1 muxrpc calls, it needs 2 muxrpc calls, and that sounds too much. I started questioning whether we need to do "mutual authentication" given that secret-handshake assures us that both sides are mutually authenticated.
Solution: I slimmed down the sign-in protocol a bit, so that there is only
cc
(client nonce),sc
(server nonce),cr
(client solution). This means that we would only need 1 muxrpc call. The idea is thatcc
andsc
act like session IDs, and all that needs to be done is the client "acknowledge" these by creating a signaturecr
that certifies those session IDs. We don't need to authenticate the peers themselves, we just need the client to certify those nonces.See these UML diagrams (that omit the error handling cases, just to make it smaller and easier to grok the dance):
Client-initiated sign-in protocol
Server-initiated sign-in protocol
PDF: rev2021-02-10.pdf