组合视图 统一视图 树状图
讨论主题 [ 上一个 | 下一个 ]
toggle
Ricardo Vela
Password Policies
2012年4月25日 下午3:17
答复

Ricardo Vela

等级: Junior Member

帖子: 85

加入日期: 2010年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
Hitoshi Ozawa
RE: Password Policies
2012年4月25日 下午4:52
答复

Hitoshi Ozawa

等级: Liferay Legend

帖子: 7954

加入日期: 2010年3月23日

最近的帖子

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
Ricardo Vela
RE: Password Policies
2012年4月26日 上午7:33
答复

Ricardo Vela

等级: Junior Member

帖子: 85

加入日期: 2010年4月14日

最近的帖子

hi Hitoshi

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


Regards
Ricardo Vela
RE: Password Policies
2012年5月9日 下午1:40
答复

Ricardo Vela

等级: Junior Member

帖子: 85

加入日期: 2010年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
RE: Password Policies
2012年5月9日 下午1:47
答复

Hiral Ramavat

等级: Junior Member

帖子: 98

加入日期: 2012年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
Ricardo Vela
RE: Password Policies
2012年5月9日 下午1:54
答复

Ricardo Vela

等级: Junior Member

帖子: 85

加入日期: 2010年4月14日

最近的帖子

Thanks!

im going to try with this...
Ricardo Vela
RE: Password Policies
2012年6月7日 上午9:44
答复

Ricardo Vela

等级: Junior Member

帖子: 85

加入日期: 2010年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