Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix client-initiated ssb-http-auth routes #130

Closed
staltz opened this issue Apr 8, 2021 · 1 comment · Fixed by #133
Closed

Fix client-initiated ssb-http-auth routes #130

staltz opened this issue Apr 8, 2021 · 1 comment · Fixed by #133
Assignees
Labels
Go golang related stuff

Comments

@staltz
Copy link
Member

staltz commented Apr 8, 2021

I'm testing ssb-http-auth between go-ssb-room and manyverse and all the basics are working, but naturally I bumped into a few small issues. Client-initiated auth means that the SSB app generates a URL and the route needs to be exactly /login not /withssb/login, because this specific /login will be the same for all servers that comply with ssb-http-auth-spec (the alternative protocol design is that there would be a muxrpc on the server to ask for its login URL, but this would be one more roundtrip).

I'm thinking that in go-ssb-room, the server could simply detect that if you call /login?cid=${cid}&cc=${cc}, it detects the presence of the cid and cc and redirects you to /withssb/login?cid=${cid}&cc=${cc}, otherwise it does the default behavior of just rendering static HTML to show you the two options (ssb-http-auth or password).

If piggybacking on the presence/absence of cid & cc is ugly, we could introduce a new parameter that makes the intent explicit, e.g. /login?ssbHttpAuth=1&cid=${cid}&cc=${cc}, where 1 works as either "true" or the version of the ssb-http-auth spec. We could update the spec with this ssbHttpAuth=1 param.

@staltz staltz added the Go golang related stuff label Apr 8, 2021
@staltz staltz self-assigned this Apr 8, 2021
@staltz staltz changed the title Fix client-initiated routes Fix client-initiated ssb-http-auth routes Apr 8, 2021
@cryptix
Copy link
Member

cryptix commented Apr 9, 2021

Ah interesting. Yes, agreed. This was mainly why I had the decideMethod() handler on /login. 😃

@staltz staltz linked a pull request Apr 9, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Go golang related stuff
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants