-
-
Notifications
You must be signed in to change notification settings - Fork 772
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
Add option to save SCRAM details on successful login and document SCRAM login #3001
Comments
Hi @based-a-tron, I'm very glad about the work you've done on this so far. Thanks! Looking at your code, the main thing I would change would be to store the Similarly to how the
The main advantage of using a Model is that the storage backend will be IndexedDB or localStorage depending on configuration and availability and it will match how everything else is stored. I didn't see an existing model that looks like a place to store the keys, so I think a new one can be created for this. One thing you didn't show, is how where you get the I think it would be great if you made a PR with the changes you've made so far. If you could change it to use a Model and not write to localStorage directly, even better. |
Yeah, I can do that. Give me a bit to sort everything out. |
You should read this one again :) |
🙈 |
Just a minor semantic detail here, how should we decide which username to select for the authentication, or should the client side logic be responsible for this?
So I dunno here. I dunno if we should expose the auto login data in a public facing API, so the business logic can select which username to login as, or what. In my specific case, I'd at least like a way to see if there is some SCRAM data saved before initializing converse, as if there is not, we try to run logic to login semi-anonymously (the user is supplied a captcha and some other information). |
I think the best would be if you just make a PR with what you have so far and then we iterate from there. It's easier for me to give feedback in the PR based on the code, and I can also check out the branch and play with it locally. |
- No need to create a new storage mechanism, just use `persistent`. - Store SCRAM keys per JID - Upon succesfull login, store the current session JID, so that we know who to fetch SCRAM keys for Fixes #3001
@jcbrand: Thanks! Linked to: |
@jcbrand Thank you very much for merging the SCRAM updates for Strophe.js!
The next logical step would be to add an option here to allow users to save their SCRAM data on login.
As discussed in the strophe pull, users can submit a password object of the form
in the normal password field now. This should probably be documented somewhere, or maybe abstracted over a bit for converse web administrators to use without having to know what a scram key is.
My users and I have been running a hacky client to accomplish this for some weeks now, where we save the data to browserstorage in https://github.com/conversejs/converse.js/blob/master/src/headless/utils/init.js after successful login, like so:
Where naturally there is a new setting called
save_scram_keys
.When
auto_login
is specified, the saved scram data should (probably?) be used by default if nopassword
field is specified.This is a rather sloppy way to do it, and I'm sure you'd like to do it in a more elegant way. Regardless, thank you very much.
The text was updated successfully, but these errors were encountered: