Security

last person joined: 2 days ago 

Forum to discuss Enterprise security using HPE Aruba Networking NAC solutions (ClearPass), Introspect, VIA, 360 Security Exchange, Extensions, and Policy Enforcement Firewall (PEF).
Expand all | Collapse all

Passport validation

This thread has been viewed 3 times
  • 1.  Passport validation

    Posted Apr 20, 2016 06:43 AM

    Hello!!

    Now for guest access  I´m using as a username the DNI of the guest (number of personal identification used in Spain) and I use as validator funtion "IsValidSpanishDNI".

    Now I want to use as a username  the  passport number of the guest if comes from another country , but I don´t know how to validate it. Is there any funtion to do it? How can I create a new one?

    Regards,

    EF



  • 2.  RE: Passport validation
    Best Answer

    Posted Apr 20, 2016 10:41 AM

    You could use the isRegexMatch validator and attempt to define your own regular expression. The problem you're going to run into is that every country is free to define their own passport numbers. You could restrict your regex to just machine readable passport numbers which appear to be 9 characters (letters or digits). http://www.highprogrammer.com/alan/numbers/mrp.html 

     

    IsRegexMatch – Checks that the value matches a regular expression supplied as an argument to the validator. The regular expression should be a Perl-compatible regular expression with delimiters. For example, the validator argument /^a/i will match any value that starts with an “a”, case-insensitively.