-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
auth: Use client-side sessions, more secure authentication.
This tracks corresponding changes to the webmail backend in LBBS commit 3eecedf731fe4e5e411141ea0503477a89dced45. Accordingly: * Instead of using server-side sessions, a cookie is used to store server connection info, since this is client-driven anyways. * The password is no longer sent directly to the server for storage. Instead, the password is encrypted locally and the encryption key is sent to the server, where the server encrypts it into an encrypted JWT (JWE) and returns that to the client in a cookie, as well as in subsequent HTTP responses. This ensures that neither the server nor the client stores the password offline. * IMAP login is handled explicitly as a separate step during setup, rather than being bundled as part of WebSocket setup. This allows users to see what authentication protocols are supported before authenticating. * Currently, only the PLAIN auth method is supported, as before. However, in the future challenge/response auth methods could be added, and this would allow clients to authenticate to an IMAP server without the webmail server ever seeing the plaintext password. * Because client-side sessions are fixed, the 'Remember Me' functionality, which never worked properly previously, now should work. * All JavaScript is now contained in separate files, which allows the Content Security Policy forbidding unsafe inline JavaScript to always be used.
- Loading branch information
1 parent
0132ece
commit c33cc02
Showing
9 changed files
with
1,377 additions
and
724 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
{ | ||
"require": { | ||
"phpmailer/phpmailer": "^6.8" | ||
"phpmailer/phpmailer": "^6.8", | ||
"web-token/jwt-encryption": "^3.2", | ||
"web-token/jwt-encryption-algorithm-aescbc": "^3.2", | ||
"web-token/jwt-encryption-algorithm-aeskw": "^3.2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.