Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > Should Kentico develop a configuration item that allows you to use email address as login username? View modes: 
User avatar
Member
Member
joeh42 - 5/18/2012 9:25:56 AM
   
Should Kentico develop a configuration item that allows you to use email address as login username?
Many websites use email addresses as the login username.

My site was populating the email address into the username field to allow this to happen, but we just ran into the issue that apostrophes, and some other special characters, are not allowed characters in the username field.

I have read in the forum that we can modify the logon web part to leverage the email address field instead of the username field.

But since many websites use this as a standard, should Kentico provide it as a built in feature? Since some sites may prefer to use a different username instead, it would be great if Kentico provided a configuration item that would allow users to login with email address. Some may sites may even want the ability to login with the possibility of using either at any given time (although I don't need it myself).

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 5/18/2012 1:58:17 PM
   
RE:Should Kentico develop a configuration item that allows you to use email address as login username?
Hi,

I am not sure I am following. By default the e-mail address is used as user name in Kentico CMS. The special characters are also not allowed by default, but you can still use a web.config key and use custom reg-ex to validate the user names:

<add key="CMSUserValidationRegEx" value="([A-Za-z0-9-]+)" />

Sets custom regular expression used for user name validation (used when new accounts are created or when existing usernames are modified).

The default value is "^[a-zA-Z0-9_\\-\\.@]+$".

If the CMSEnsureSafeUserNames key is set to false, the following regular expression is used by default: "^[a-zA-Z0-9_\\-\\.\\\\@]+$".


Best regards,
Juraj Ondrus

User avatar
Member
Member
joeh42 - 5/18/2012 2:37:27 PM
   
RE:Should Kentico develop a configuration item that allows you to use email address as login username?
My specific problem is that the Kentico user name field does not allow apostrophes. I'm reading that as per RFC2822 they are valid characters in an email address.

I'm aware that it's not a trivial problem to validate email addresses. Do you consider this a bug? Or, is there a specific reason that Kentico is disallowing apostrophes in the username field?


As per your suggestion, I added the following custom regular expression. It seems to meet our needs for the moment, and I'll continue to test.
<add key="CMSUserValidationRegEx" value="^[a-zA-Z0-9_\\-\\.@\']+$" />


Thanks,
Joe

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 5/22/2012 3:22:50 PM
   
RE:Should Kentico develop a configuration item that allows you to use email address as login username?
Hi,

Using those characters in user names and e-mails can cause some issues and it is better to avoid them even if they are allowed according to the RFC. Also some e-mail providers do not allow them, like Google.

Best regards,
Juraj Ondrus