10-17-2016 04:16 AM - edited 10-18-2016 04:41 AM
I'm using a clearpass selfreg portal to allow visitors to register for access. The customer want to limit this and want to use the visitors mobile phone number to do so.
So I've replaced the email field with the username field and am trying to limit this field so 1 phone number can create 1 account.
this seems problematic and I'm hoping someone here can help me get this resolved.
The Clearpass Guest user guide v6.6 mentions NwaSmsIsValidPhoneNumber. This seems to pretty much do what I need... but not quite.
It should be doing the following:
- Validates a phone number supplied in E.164 international dialing format, including country code.
- Any spaces and non-alphanumeric characters are removed.
- If the first character is a plus sign (+), the phone number is assumed to be in E.164 format already and the
plus sign is removed; otherwise, if the SMS service handler national prefix is set and the phone number
starts with that prefix, then the prefix is replaced with the country code.
- The phone number must contain no fewer than 5 and no more than 15 digits.
- The phone number is validated for a valid country code prefix.
- If all the foregoing conditions are met, the validator returns TRUE; otherwise, the validator returns FALSE.
It does check and throw up an error for certain issues but not for all that I would expect. E.g.: it does filter out forward slash (/) and some other symbols from the phone numbers, but not any period (.).
It also doesn't stop visitors from entering spaces wherever they like.
So I dug a bit further into the Advanced properties and enabled Conversion: NwaNormalizePhoneNumber. This helps as it actualy changes the number entered and removed any non-numerical characters.
However, this still allows the user to enter both 32471234567 and 0471234567 as phone number.
So here I am mising that ", if the SMS service handler national prefix is set and the phone number starts with that prefix, then the prefix is replaced with the country code." function of the validator.
Anybody have an idea how I can force all this? That is:
- remove non-numerical characters
- if the number starts with 0 (national prefix), replace that zero with 32 (country code) before creating the account.
-- Found something helpful, important, or cool? Click the Kudos Star in a post.
-- Problem Solved? Click "Accept as Solution" in a post.