Skip to content

Load/store FAST keys for auto_login. #3693

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

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

kousu
Copy link

@kousu kousu commented Jun 9, 2025

Also clean up FAST and SCRAM keys on log out; otherwise, the credentials are still in the browser, and could be stolen, or reused simply by someone who knows to redefined conversejs-session-jid in localStorage.

Fixes #3144

Depends on strophe/strophejs#840. The bulk of the work is in that pull.

TODO:

  • This renames reuse_scram_keys to reuse_keys to cover both FAST and SCRAM, so it should probably get a backwards-compatibility shim for the old name.
  • Drop my development environment edit to package.json (without there's no way to test because both repos need to be in sync)

Before submitting your request, please make sure the following conditions are met:

  • Add a changelog entry for your change in CHANGES.md
  • When adding a configuration variable, please make sure to
    document it in docs/source/configuration.rst
  • Please add a test for your change. Tests can be run in the commandline
    with make check or you can run them in the browser by running make serve
    and then opening http://localhost:8000/tests.html.

@kousu
Copy link
Author

kousu commented Jun 9, 2025

Demo:

Logging in with a password and catching a FAST token

2025-06-09-123704_1366x768_scrot

The token is in IndexedDB:

2025-06-09-123552_1366x768_scrot

Upon reloading, logs in using FAST:

2025-06-09-123620_1366x768_scrot

Upon logging out, the token is wiped from memory:

2025-06-09-124043_521x222_scrot

2025-06-09-124349_1366x768_scrot

Comment on lines +1890 to +1891
reuse_keys
----------
Copy link
Author

@kousu kousu Jun 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I chose to repurpose reuse_scram_keys to also cover FAST because they are so similar. But there's other options

  • add a separate reuse_fast_keys option
  • make FAST always enabled, or maybe just a fast that defauls to true.

I'm not sure how is best or what your preferences are. Lemme know :)

kousu added 2 commits June 10, 2025 13:23
Also clean up FAST *and* SCRAM keys on log out;
otherwise, the credentials are still in the browser,
and could be stolen, or reused simply by someone
who knows to redefined conversejs-session-jid in localStorage.

Depends on strophe/strophejs#839

TODO:

* [ ] This *renames* reuse_scram_keys to reuse_keys to cover
      both FAST and SCRAM, so it should probably get a
      backwards-compatibility shim for the old name.
* [ ] Drop my development environment edit to package.json
      (without there's no way to test because both
      repos need to be in sync)
"version": "4.0.0-rc0",
"resolved": "https://registry.npmjs.org/strophe.js/-/strophe.js-4.0.0-rc0.tgz",
"integrity": "sha512-9j2hR/OsxFX1gmqcsxNOQySrUUju0blHAmGB5g5EcdlVjWn19u+xHKEoXt4Ft8VPBB9rQR0jvtQkAJPpqM9XTw==",
"version": "3.1.1",
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I imagine before this lands I'll have to redo it against 4.0. Hopefully it's not too complicated :)

@jcbrand
Copy link
Member

jcbrand commented Jun 20, 2025

Hi @kousu, thank you for the effort you've put into this so far. I'm just writing to let you know this is still on my radar and I plan to do an in-depth review soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support XEP-0484: Fast Authentication Streamlining Tokens
2 participants