05-17-2019 03:49 PM - edited 05-17-2019 03:56 PM
Hi,
Please, could anyone help me?
I am creating a Guest Portal and according to Law we need to store the data of the user (Name, Phone, Email and CPF).
CPF (represents the ID of the Brazilian identity document) in format "999.999.999-99". I've created a new custom field for this.
However, to verify that the identity document is valid or invalid there is a javascript algorithm for validation.
I need help to do the validation of this custom field called CPF with some javascript. I do not know how to make the javascript call on CISCO ISE.
Links with the Javascript of validation of the CPF.
Script validation CPF https://www.geradorcpf.com/javascript-validar-cpf.htm
Test validation CPF https://www.geradorcpf.com/validar-cpf.htm
Mask JQuery https://www.geradorcpf.com/mascara-cpf-com-jquery.htm
On the internet there are other sites with the CPF validation algorithm
Thank you very much
Mauricio Pissinati
PS - I had made another Post, but when editing something went wrong and so I created this new post.
Solved! Go to Solution.
05-30-2019 08:35 AM
05-17-2019 04:31 PM
05-17-2019 08:48 PM
Hi Jason,
I'm adding a YouTube video where the analyst explains the valid CPF algorithm. The audio is in Portuguese but visually it is possible to understand the validation code.
The first check digit is the sum of the first 9 numbers. The second check digit is the sum of the 10 numbers.
Having the mask is also necessary.
YouTube = https://youtu.be/aSUeH3Y31IQ
I attached an image
On this site you can generate a valid CPF to use during the tests.
https://www.geradorcpf.com/
In this link has the rule for the validation of the CPF:
https://www.geradorcpf.com/algoritmo_do_cpf.htm
At the end of this page there are links to the javascript code already ready to implement.
For example:
CPF "458.139.718-90" is valid.
If you change any number the CPF "458.139.718-91" for example is not valid.
Every person in Brazil has their own CPF. It is your personal identification code (similar to the passport number), we can use this information to audit who was the user who used the Guest Portal to surf the internet and track who misused the resource.
I hope I have been able to explain my need better.
Thank you very much
Mauricio
05-18-2019 12:32 AM
05-19-2019 07:44 PM
Only validation if the CPF ID is valid is enough. We'll avoid too many junk registrations.
We will not cross the GUEST Portal with the base of the government.
You will make the Term of Acceptance where the user is responsible for informing the true data (if one day we need to respond to the audit or legal actions, we will cross manually with another data source to know if the CPF ID actually belongs to that user).
Thanks
05-20-2019 11:38 AM - edited 05-28-2019 08:12 AM
ok thanks will ask to see if we can help with this
still working with development - 5/28/19
05-29-2019 07:44 AM
05-29-2019 09:35 AM
05-29-2019 09:16 AM
05-30-2019 08:35 AM
05-31-2019 08:18 AM
05-31-2019 12:23 PM
Hi Jason,
I've enabled Inspect in Chrome browser and I've been able to identify the field.
<input type="text" name="guestUser.fieldValues.ui_cpf_text" data-validation-type="TEXT" maxlength="256" id="guestUser.fieldValues.ui_cpf_text" ....
Made this validation script using regex. This script does not calculate if the CPF is true or false, but it will already help a lot, while I await the process of purchasing specialized services for the Portal.
<script>
setTimeout(function(){
$.validator.addMethod("validaCPF", function(value, element) {
return /^(([0-9]{3}[.]?[0-9]{3}[.]?[0-9]{3}[-]?[0-9]{2})|([0-9]{11}))$/.test( value );
}, 'Please provide your real CPF number.');
jQuery("[name='guestUser.fieldValues.ui_cpf_text']").rules("add",{validaCPF:true});
}, 50);
</script>
it's working fine
06-03-2019 09:28 AM
01-03-2020 04:33 PM
Hi guys, I have the same problem, any solution?
01-03-2020 07:38 PM
This was answered
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide