chrisxhartmann
Contributor
Contributor

Password validation not working

Jump to solution

Hi,

I have a workflow that requires the user to define a new password that must meet complexity requirements. The workflow uses custom validation on a field within the form based on the below action:

var length = /^[\s\S]{8,32}$/,

upper = /[A-Z]/,

lower = /[a-z]/,

number = /[0-9]/,

special = /[^A-Za-z0-9]/,

count = 0;

// Check password meets length requirement

if (length.test(password)) {

// Only need 3 out of 4 of these to match

if (upper.test(password)) count++;

if (lower.test(password)) count++;

if (number.test(password)) count++;

if (special.test(password)) count++;

}

else {

return "Password does not meet length requirements"

}

if (count < 3){

return "Password does not meet complexity requirements"

}

else {

return true

}

For the password input parameter call I am using #__current, which works through the vRO client but doesn't work via the vCenter plugin. In this instance, no matter what is entered it just returns "Password does not meet complexity requirements". Can someone assist with getting this working?

0 Kudos
1 Solution

Accepted Solutions
iiliev
VMware Employee
VMware Employee

Hi,

Not all presentation features available in vRO Java client are ported to work on vSphere Web client. In your case, it is #__current variable.

Could you try to replace #__current with #yourinputname in the custom validation expression? (assuming yourinputname is is the name of the input parameter you want to validate)

View solution in original post

0 Kudos
4 Replies
iiliev
VMware Employee
VMware Employee

Hi,

Not all presentation features available in vRO Java client are ported to work on vSphere Web client. In your case, it is #__current variable.

Could you try to replace #__current with #yourinputname in the custom validation expression? (assuming yourinputname is is the name of the input parameter you want to validate)

View solution in original post

0 Kudos
chrisxhartmann
Contributor
Contributor

Hi Ilian,

Is it definitely the case that #__current variable does not get ported across? I am quite sure it was working in the workflow last week. Also whilst using #__current, if I select from another field on the form that forces validation (eg. I have a drop down that performs a lookup on a SQL table to populate it) then the text in the fields where #__current is used also gets validated at the same time and they then work correctly (the downside being that the text can then be changed and unless another validation occurs it will pass even though it may not be valid). Is there a mechanism whereby validation can be forced when you deselect a field as it seems that would server my purposes?

I agree, I can use #yourinputname but this method pops up a validating message whilst the user types which does not give a very nice user experience.

Thanks,

Chris.

0 Kudos
iiliev
VMware Employee
VMware Employee

Hi Chris,

Using #__current also would cause validation message to pop up while you are typing. You can check this easily if you add some logging statements in your custom validation action code and then type something in vRO client presentation; you'll notice that the action will be invoked several times, perhaps even more than once for each character. It is not so noticeable in vRO client as all calls are local, whereas in vSphere Web client all validation calls are remote REST API calls which take considerably more time and so you see the annoying validation pop up message.

0 Kudos
chrisxhartmann
Contributor
Contributor

Hi Ilian,

We don't want to expose the vRO client to users when we already have them accessing vCenter so I guess we'll just have to live with the validation text. A shame it isn't a cleaner experience, but thanks for your help.

Thanks,

Chris.

0 Kudos