You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by Aaron Evans <aa...@gmail.com> on 2006/03/09 18:01:56 UTC

Email Addresses as Usernames problem

While I was looking into my portlet preference problems, I discovered
something else that is problematic for me.

All our user names are people's email addresses.

The dot in the email addresses seem to cause the user name to be split into
multiple nodes in the preference node tree.  For example,
user@example.comgets represented as
user@example/com.

This is the first time I have noticed this since i haven't looked in the DB
before and hasn't seemed to cause any problems yet, but I could see this
potentially being a big problem if I had two users:

john.smith@example.com
john.doe@example.com

I can see in org.apache.jetspeed.security.BasePrincipal that this is done on
purpose:
"Hierarchical principal names should follow: {principal}.{subprincipal}. "."
is used as the separator for hierarchical elements."

The dots are explicitly replaced with slashes causing the node split.

So firstly, I would like to point out that it is relatively common for
people to use email addresses for user names for portals.

Secondly, do I need to do something about this?  Is this going to cause me
any problems?

thx,
aaron

Re: Email Addresses as Usernames problem

Posted by David Sean Taylor <da...@bluesunrise.com>.
Aaron Evans wrote:
> Cool, thx.  Yeah, after I thought about it a little more, I figured it
> probably wouldn't matter as the stuff for john.smith would still be kept
> separate from john.doe.  They would just happen to have a common parent
> node...
> 
In case you require that usernames are stored in the database in a true 
representation, the patch below might be useful for you

BasePrincipalImpl.java


     public static String getFullPathFromPrincipalName(String name, 
String prefsRoot)
     {
         String fullPath = name;

         // PATCH : DST
         if (null != fullPath && 
!prefsRoot.startsWith(UserPrincipalImpl.PREFS_USER_ROOT))
//        if ( null != fullPath)
         {
             fullPath = prefsRoot + fullPath.replace('.', '/');
         }
         else
         {
             fullPath = prefsRoot + fullPath;
         }
         return fullPath;
     }

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: Email Addresses as Usernames problem

Posted by Aaron Evans <aa...@gmail.com>.
Cool, thx.  Yeah, after I thought about it a little more, I figured it
probably wouldn't matter as the stuff for john.smith would still be kept
separate from john.doe.  They would just happen to have a common parent
node...



On 3/9/06, Randy Watler <wa...@wispertel.net> wrote:
>
> Aaron,
>
> We had the same issue... and no you dont have to worry about it unless
> you inspect or load the security DB manually. There, just convert the
> '.' to '/' and it should be fine.
>
> Randy
>
> Aaron Evans wrote:
> > While I was looking into my portlet preference problems, I discovered
> > something else that is problematic for me.
> >
> > All our user names are people's email addresses.
> >
> > The dot in the email addresses seem to cause the user name to be split
> into
> > multiple nodes in the preference node tree.  For example,
> > user@example.comgets represented as
> > user@example/com.
> >
> > This is the first time I have noticed this since i haven't looked in the
> DB
> > before and hasn't seemed to cause any problems yet, but I could see this
> > potentially being a big problem if I had two users:
> >
> > john.smith@example.com
> > john.doe@example.com
> >
> > I can see in org.apache.jetspeed.security.BasePrincipal that this is
> done on
> > purpose:
> > "Hierarchical principal names should follow: {principal}.{subprincipal}.
> "."
> > is used as the separator for hierarchical elements."
> >
> > The dots are explicitly replaced with slashes causing the node split.
> >
> > So firstly, I would like to point out that it is relatively common for
> > people to use email addresses for user names for portals.
> >
> > Secondly, do I need to do something about this?  Is this going to cause
> me
> > any problems?
> >
> > thx,
> > aaron
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>
>

Re: Email Addresses as Usernames problem

Posted by Randy Watler <wa...@wispertel.net>.
Aaron,

We had the same issue... and no you dont have to worry about it unless 
you inspect or load the security DB manually. There, just convert the 
'.' to '/' and it should be fine.

Randy

Aaron Evans wrote:
> While I was looking into my portlet preference problems, I discovered
> something else that is problematic for me.
>
> All our user names are people's email addresses.
>
> The dot in the email addresses seem to cause the user name to be split into
> multiple nodes in the preference node tree.  For example,
> user@example.comgets represented as
> user@example/com.
>
> This is the first time I have noticed this since i haven't looked in the DB
> before and hasn't seemed to cause any problems yet, but I could see this
> potentially being a big problem if I had two users:
>
> john.smith@example.com
> john.doe@example.com
>
> I can see in org.apache.jetspeed.security.BasePrincipal that this is done on
> purpose:
> "Hierarchical principal names should follow: {principal}.{subprincipal}. "."
> is used as the separator for hierarchical elements."
>
> The dots are explicitly replaced with slashes causing the node split.
>
> So firstly, I would like to point out that it is relatively common for
> people to use email addresses for user names for portals.
>
> Secondly, do I need to do something about this?  Is this going to cause me
> any problems?
>
> thx,
> aaron
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org