Reputation: 386
I have set the following password policy [\sa-zA-Z0-9]{10,30}$
in WSO2 IS in Identity Provider->Resident->Password Policies->Password Patterns.
I have added the \s to support the white spaces but I get an error when trying to add a password with a white spaced within it.
Caused by: org.wso2.carbon.user.core.UserStoreException: 30003 - Credential is not valid. Credential must be a non null string with following format, ^[\S]{5,30}$
I use WSO2 IS 5.9.
Do I have to set any other special characters in the regular expression or to do additional configuration in WSO2 IS?
Upvotes: 0
Views: 296
Reputation: 3057
There is a regex validation at the user-store level too. You can change them by adding the following config to the deployment.toml
and restart the server.
(Note: If [user_store]
is already defined in the deployment.toml add these configs under the same tag)
[user_store]
password_java_regex="^[\\sa-zA-Z0-9]{10,30}$"
password_java_script_regex="^[\\sa-zA-Z0-9]{10,30}$"
Once the server gets restarted you can see the modified values of PasswordJavaRegEx
(regex for backend validation in userstore level) and PasswordJavaScriptRegEx
(regex for UI validation) in <wso2is>/repository/conf/user-mgt.xml
file.
Upvotes: 1