You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adding support for optional Password Policy (#3032)
* adds resetTokenValidityDuration setting
* adds a validator to validate password that can be used to enforce strong
passwords
* adds unit tests for passwordPolicy.validator
* adds unit tests to to fail reset password function if password is not in a valid format
* updates README.md for passwordPolicy
* prevents duplicate check for password validator in updateUserPassword
* adds optional setting to disallow username in password
* updates test cases to use fdescribe instead of describe
* updates test cases to use request-promise instead of request
* adds ability to use a RegExp or Callback function or both for a passwordPolicy.validator
* expect username parameter in redirect to password_reset_success
* adds support for _perishable_token_expires_at in postgres
Copy file name to clipboardExpand all lines: README.md
+13Lines changed: 13 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -216,6 +216,7 @@ The client keys used with Parse are no longer necessary with Parse Server. If yo
216
216
*`sessionLength` - The length of time in seconds that a session should be valid for. Defaults to 31536000 seconds (1 year).
217
217
*`revokeSessionOnPasswordReset` - When a user changes their password, either through the reset password email or while logged in, all sessions are revoked if this is true. Set to false if you don't want to revoke sessions.
218
218
*`accountLockout` - Lock account when a malicious user is attempting to determine an account password by trial and error.
219
+
*`passwordPolicy` - Optional password policy rules to enforce.
219
220
220
221
##### Logging
221
222
@@ -277,6 +278,18 @@ var server = ParseServer({
277
278
duration:5, // duration policy setting determines the number of minutes that a locked-out account remains locked out before automatically becoming unlocked. Set it to a value greater than 0 and less than 100000.
278
279
threshold:3, // threshold policy setting determines the number of failed sign-in attempts that will cause a user account to be locked. Set it to an integer value greater than 0 and less than 1000.
279
280
},
281
+
// optional settings to enforce password policies
282
+
passwordPolicy: {
283
+
// Two optional settings to enforce strong passwords. Either one or both can be specified.
284
+
// If both are specified, both checks must pass to accept the password
285
+
// 1. a RegExp representing the pattern to enforce
286
+
validatorPattern:/^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.{8,})/, // enforce password with at least 8 char with at least 1 lower case, 1 upper case and 1 digit
287
+
// 2. a callback function to be invoked to validate the password
0 commit comments