You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Dr. Thomas W. Richter" <TW...@t-online.de> on 2001/05/28 23:33:00 UTC

RE:RE:RE: RE: RE: How to get Role and Password from JDBC Rea... - not in 3.2.2??

Hmm, thanks again Jan,

but this method isn't available in Tomcat 3.2.2. So I fear I must perform getting userrole and userpass manually. How can I read out server.xml so that I have not to write a properties file where the name of the auth DB, useradminname and useradminpass once again?

Thank you again for help, I do not understand how JDBCRealm reads out server.xml

Thomas

Jan wrote:

From: "Pernica, Jan" 
Subject:  RE: RE: How to get Role and Password from JDBC Realme -using 3.2. 2
Date:  Mon, 28 May 2001 17:15:36 +0200

The username and the password is part of the request. you can get it
from
	org.apache.catalina.util.Base64 base64Helper = new
org.apache.catalina.util.Base64();
	String unencoded = new
String(base64Helper.decode(request.getHeader("authorization").getBytes()));
	int colon = unencoded.indexOf(':');
	if (colon < 0)
	    return (null);
	String username = unencoded.substring(0, colon).trim();
	String password = unencoded.substring(colon + 1).trim();

I hope it helps

Jan

On Monday, May 28, 2001 4:56 PM, me@twrichter.de
[SMTP:me@twrichter.de]
wrote:
> Thanks Jan,
>
> I have to apologize not to have explained the intended usage:
> I need username, userpassword and userrole since I will use it
for
> DB-Authorization (GRANT to group, and user to tables and so on,
connecting
> DB with username,userpass). I intend to synchronize username,
password and
> role with the authDB of the specific Datebase (Interbase and
isc4.gdb). Is
> there a methode like org.apache.catalina.realm.GenericPrincipal
principal
> = request.getUserPrincipal() for Tomcat 3.2.2 and is there an
elegant
> method for attaching password, too?
>
> Thank you for help
>    Thomas