留言板

Password Policies

thumbnail
Ricardo Vela,修改在11 年前。

Password Policies

Junior Member 帖子: 85 加入日期: 10-4-14 最近的帖子
hi

I'm editing password policies on my portal, but i want to have something that is not available by now. I want passwords to have at least:

- 1 uppercase (A-Z)
- 1 lowercase (a-z)
- 1 digit (0-9)

besides the length of the password, is there a way to enable that or i have to do it directly on the code? if the second, where can i start (which classes have the password policies?)

Thanks!


Regards
thumbnail
Hitoshi Ozawa,修改在11 年前。

RE: Password Policies

Liferay Legend 帖子: 7942 加入日期: 10-3-24 最近的帖子
You really don't need to modify any code. Just add the following property in portal-ext.properties:

#
# If you choose to use com.liferay.portal.security.pwd.RegExpToolkit as
# your password toolkit, set the regular expression pattern that will be
# used to generate and validate passwords.
#
# Note that \ is replaced with \\ to work in Java.
#
# The first pattern ensures that passwords must have at least 4 valid
# characters consisting of digits or letters.
#
# The second pattern ensures that passwords must have at least 8 valid
# characters consisting of digits or letters.
#
passwords.regexptoolkit.pattern=(?=.{4})(?:[a-zA-Z0-9]*)

#
# Set the character sets for password validation.
#
passwords.passwordpolicytoolkit.charset.lowercase=abcdefghjkmnpqrstuvwxyz
passwords.passwordpolicytoolkit.charset.numbers=0123456789
passwords.passwordpolicytoolkit.charset.symbols=_.!@$*=-?
passwords.passwordpolicytoolkit.charset.uppercase=ABCDEFGHJKLMNPQRSTUVWXYZ

If you want to write your own policy, just specify your class here:
#
# Input a class name that extends
# com.liferay.portal.security.pwd.BasicToolkit. This class will be called to
# generate and validate passwords.
#
passwords.toolkit=com.liferay.portal.security.pwd.PasswordPolicyToolkit
#passwords.toolkit=com.liferay.portal.security.pwd.RegExpToolkit
thumbnail
Ricardo Vela,修改在11 年前。

RE: Password Policies

Junior Member 帖子: 85 加入日期: 10-4-14 最近的帖子
hi Hitoshi

Thanks for the quick answer! Im going to add them!


Regards
thumbnail
Ricardo Vela,修改在11 年前。

RE: Password Policies

Junior Member 帖子: 85 加入日期: 10-4-14 最近的帖子
hi Hitoshi

i have a question... do this work on liferay 5.2.3 version???

i added the properties you gave me, but if i try to change the password ignoring them it lets me do it...


Regards
Hiral Ramavat,修改在11 年前。

RE: Password Policies

Regular Member 帖子: 103 加入日期: 12-2-13 最近的帖子
Hi,

For Liferay 5.2.3, below are the properties that you need to set.

#
# If you choose to use com.liferay.portal.security.pwd.RegExpToolkit as
# your password toolkit, set the regular expression pattern that will be
# used to generate and validate passwords.
#
# Note that \ is replaced with \\ to work in Java.
#
# The first pattern ensures that passwords must have at least 4 valid
# characters consisting of digits or letters.
#
# The second pattern ensures that passwords must have at least 8 valid
# characters consisting of digits or letters.
#

passwords.regexptoolkit.pattern=(?=.{4})(?:[a-zA-Z0-9]*)
#passwords.regexptoolkit.pattern=(?=.{8})(?:[a-zA-Z0-9]*)

#
# Set the length and key for generating passwords.
#
#passwords.regexptoolkit.charset=0123456789
passwords.regexptoolkit.charset=0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
#passwords.regexptoolkit.length=4
passwords.regexptoolkit.length=8

#
# Set the name of the default password policy.
#
passwords.default.policy.name=Default Password Policy

Hope it will work for you.

Thanks,
Hiral
thumbnail
Ricardo Vela,修改在11 年前。

RE: Password Policies

Junior Member 帖子: 85 加入日期: 10-4-14 最近的帖子
Thanks!

im going to try with this...
thumbnail
Ricardo Vela,修改在11 年前。

RE: Password Policies

Junior Member 帖子: 85 加入日期: 10-4-14 最近的帖子
hi...

I tried it, but it is not working... im facing this requirement and i thing im going to change code to make this work...


thanks anyway emoticon