db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Francois Orsini" <francois.ors...@gmail.com>
Subject Re: Accept username of form xyz@somedomain.com
Date Mon, 20 Feb 2006 01:39:46 GMT
On 2/10/06, Sunitha Kambhampati <ksunithaghm@gmail.com> wrote:
> Hello All,
>
> I have a case where the username can be  xyz@somedomain.com . The only
> way I can get derby to accept this username is if I  quote it.  - ie
> "xyz@domain.com". I think that it is possible for different
> authentication mechanisms (e.g ldap) that are pluggable into derby, to
> have username of the form xyz@somedomain.com.    I want to allow such
> usernames.
>

Today it is possible to map a user created in derby to one defined in
LDAP  - for instance, in your example, you could have 'xyz' mapped to
a user DN in ldap - not sure it is common to have 'xyz@domain.com' as
a user name in ldap (i.e. 'cn=xyz,ou=People,o=FlyTours.com'), this
information can be extracted out of the email in the directory tree if
a proper search filter is defined (that's another possibility) - the
DN could also reference some LDAP email attribute. I know this is just
one case but the mapping allows to separate the SQL Ansi
authentication identifier with some other (external) types (i.e.
LDAP)....

> If I try to connect, the error thrown is
>     ij> connect
> 'jdbc:derby:testdb;create=true;user=skambha@xyz.com;password=a';
>     ERROR 28502: The user name 'skambha@xyz.com' is not valid.
>
> The first error is being thrown from this method in
> org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext#getAuthorizationId(String
> username) This method calls the IdUtil.parseId() which will for an
> unqualified id,  check if the string has only characters from a-z, A-Z
> and _ and digits.
> I want to remove this restriction for the username case.
>
> So it would be like this once I remove the restriction.
> ij version 10.2
> ij> connect 'jdbc:derby:GHMDB;user=skambha@xyz.com;password=p';
> ij> create table t2(i1 int);
> 0 rows inserted/updated/deleted
> ij> select * from sys.sysschemas where schemaname='SKAMBHA@XYZ.COM';
> SCHEMAID                            |SCHEMANAME
> ------------------------------------------------------------------------------
> 4d6f406a-0109-5672-a66d-000000143840|SKAMBHA@XYZ.COM
>
> 1 row selected
> ij> select * from "SKAMBHA@XYZ.COM".t1;
> I1
> -----------
>
> 0 rows selected
> ij>
>
>
>
> Is this reasonable.   Thoughts/comments?
>
> If noone objects, I will be posting a patch to address this.
>
> Thanks,
> Sunitha.
>

Mime
View raw message