cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
5622
Views
0
Helpful
15
Replies

CISCO ISE 2.4 - Guest Portal - CPF Field (validation with javascript)

mpissinati
Level 1
Level 1

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.

 

 

1 Accepted Solution

Accepted Solutions

Right now this is looking to be a little more work then normal scripting requests and doubtful we can deliver without an engagement with a vendor that does advanced customization. If you would like to engage a vendor very familiar with ISE then please reach out to me directly with your mailing address

View solution in original post

15 Replies 15

Jason Kunst
Cisco Employee
Cisco Employee
I will look into it, thanks for clearing it up. Is there perhaps a mock-up image you can use to edit and insert in same post?

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

Ok how do you expect to validate that the code is indeed their code? Having the portal reach out direct to another site may not be allowed. Are you simply validating format and physically validate an ID card to match later?

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

ok thanks will ask to see if we can help with this

still working with development - 5/28/19

PLease send me your email address to work further

mpissinati@timbrasil.com.br

Hi Jason,
Could you tell me how to find the "ui_" of the custom fields in CISCO ISE?
"guestUser.fieldValues.optionalData 1"
or
"guestUser.fieldValues.ui_CPF"

I find documents only for default fields
"guestUser.fieldValues.ui_phone_number"

Since I need to put the Portal in Operation, I will try to create a regex initially.

<script>
setTimeout(function(){
$.validator.addMethod("validaCPF", function(value, element) {
return /([0-9]{2}[\.]?[0-9]{3}[\.]?[0-9]{3}[\/]?[0-9]{4}[-]?[0-9]{2})|([0-9]{3}[\.]?[0-9]{3}[\.]?[0-9]{3}[-]?[0-9]{2})/.test( value );
}, 'Please cpf OK.');
jQuery("[name='guestUser.fieldValues.optionalData 1']").rules("add",{validaCPF:true});
}, 50);
</script>

Tks

Right now this is looking to be a little more work then normal scripting requests and doubtful we can deliver without an engagement with a vendor that does advanced customization. If you would like to engage a vendor very familiar with ISE then please reach out to me directly with your mailing address

Thanks for the review. For the development of the Portal I need to open bidding for contracting services, it takes about 3 months.
Could you tell me how I have to find the ui_ of the custom fields in CISCO ISE? I'll try to validate with regex.
"guestUser.fieldValues.optionalData 1"
or
"guestUser.fieldValues.ui_CPF"

Tks

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

From our developers - Yes, that script is working fine but it is accepting invalid CPF IDs as well. I would recommend reaching out to me at jakunst@cisco.com

Hi guys, I have the same problem, any solution?

This was answered 

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: