On 2/10/06, Sunitha Kambhampati <[EMAIL PROTECTED]> wrote: > Hello All, > > I have a case where the username can be [EMAIL PROTECTED] . The only > way I can get derby to accept this username is if I quote it. - ie > "[EMAIL PROTECTED]". I think that it is possible for different > authentication mechanisms (e.g ldap) that are pluggable into derby, to > have username of the form [EMAIL PROTECTED] 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 '[EMAIL PROTECTED]' 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;[EMAIL PROTECTED];password=a'; > ERROR 28502: The user name '[EMAIL PROTECTED]' 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;[EMAIL PROTECTED];password=p'; > ij> create table t2(i1 int); > 0 rows inserted/updated/deleted > ij> select * from sys.sysschemas where schemaname='[EMAIL PROTECTED]'; > SCHEMAID |SCHEMANAME > ------------------------------------------------------------------------------ > 4d6f406a-0109-5672-a66d-000000143840|[EMAIL PROTECTED] > > 1 row selected > ij> select * from "[EMAIL PROTECTED]".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. >
