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

[#185] update documentation on shiro2 #186

Merged
merged 3 commits into from
Feb 28, 2024
Merged

Conversation

bmarwell
Copy link
Contributor

@bmarwell bmarwell commented Jul 23, 2023

fixes #185

Looking at this, does the ini parser even work now? We need to investigate before we can release Shiro 2.

Especially:

user1 = $shiro2$argon2id$v=19$t=1,m=65536,p=4$H5z81Jpr4ntZr3MVtbOUBw$fJDgZCLZjMC6A2HhnSpxULMmvVdW3su+/GCU3YbxfFQ, role1, role2, ...

I cannot recall if we tested this properly (commas...).


Edit: Added two macros to link to the v2 page (if available) or "soft-warn" about this being a v2 page.
See Screenshots, please help with the wording.

The broken icons can be fixed at a later time in another PR.

v1 page without the new tag :shiro-hasv2: true or set to false:

2024-01-23T10:25:19_Screenshot_0001

v1 page with the new tag :shiro-hasv2: true :

Screenshot_20240123_100611

v2 page:

Does not link back to v1. Should it?

2024-01-23T10:18:24_Screenshot_0001

@bmarwell bmarwell requested review from lprimak and fpapon July 23, 2023 19:17
@bmarwell
Copy link
Contributor Author

-1 Francois, we wanted to use a separate path in the URL.

@fpapon
Copy link
Member

fpapon commented Nov 11, 2023

-1 Francois, we wanted to use a separate path in the URL.

I'm not sure to follow the separate path thing, can you explain?

@lprimak
Copy link
Contributor

lprimak commented Dec 20, 2023

I published this PR at https://shiro.staged.apache.org
Take a peek :)

@lprimak
Copy link
Contributor

lprimak commented Dec 23, 2023

I have tested the ini configuration, and this works (and should be documented):

user1 = "$shiro2$argon2id$v=19$t=1,m=65536,p=4$H5z81Jpr4ntZr3MVtbOUBw$fJDgZCLZjMC6A2HhnSpxULMmvVdW3su+/GCU3YbxfFQ", role1, role2, ...

@lprimak
Copy link
Contributor

lprimak commented Dec 23, 2023

Sorry about my earlier comments about SHA256 being deprecated. I confused SHA256CredentialMatcher with SHA256Hash which is not deprecated.
Carry on!

Honestly I think we are close to beta now!

@bmarwell bmarwell marked this pull request as ready for review January 23, 2024 09:26
@bmarwell
Copy link
Contributor Author

bmarwell commented Jan 23, 2024

So, updated the structure but have not yet copied everything over. We can do it now or later, two new macros should help with this.

Later fixes:

  • copy over other files
  • Add shiro-hasv2: true tags where appropriate
  • fix the admonition icons
  • Fix the menu to contain more links, eg. the command-line-hasher file itself.
  • Move https://shiro.apache.org/jakarta-ee.html to v2, too.

@@ -439,40 +439,33 @@ Each line in the [users] section must conform to the following format:
[#Configuration-INIConfiguration-Sections-users-EncryptingPasswords]
===== Encrypting Passwords

If you don't want the [users] section passwords to be in plain-text, you can encrypt them using your favorite hash algorithm (MD5, Sha1, Sha256, etc.) however you like and use the resulting string as the password value. By default, the password string is expected to be Hex encoded, but can be configured to be Base64 encoded instead (see below).
Since Shiro 2.0, the `[users]` section cannot contain plain-text passwords.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this actually true? I seem to remember this plain-text passwords work in shiro 2 at the moment

If unsure, use argon2 derived passwords.

The algorithms from Shiro 1 (e.g. md5, SHA1, SHA256, etc.) are long deemed insecure and not supported anymore.
There is neither a direct migration path nor backward compatibility.
Copy link
Contributor

Choose a reason for hiding this comment

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

This is technically not true since Shiro 2 can encrypt / decrypt Shiro 1.x passwords. There is forward-and-backward path for compatibility as I tested this recently. This is a good thing IMHO.
Currently, it takes some "finagling" to get working which I think is a good thing, it makes compatibility possibly but use Argon2 by default.

Copy link
Contributor

@lprimak lprimak left a comment

Choose a reason for hiding this comment

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

Looks great! See some of my inline comments though

@lprimak lprimak merged commit 5b96b97 into main Feb 28, 2024
1 check passed
@lprimak lprimak deleted the #185_update_crypto_docs branch February 28, 2024 20:02
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.

Update docs about Password Hashing Algorithms
3 participants