tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Reynir Hübner <rey...@hugsmidjan.is>
Subject RE: Retrieving username and password from url??
Date Mon, 02 Dec 2002 09:14:06 GMT
Hi, 

Depending on the browser and authentication scheme this will may try to authenticate against
tomcat. 
There for you should be able to do request.getRemoteUser() on (at least) the first request
that has the authenticative username:password. 
request.getRemoteUser() only returns the username, you can get the Authentication header wich
is formed like this in BASIC authentication scheme: 
String user_Password = login+ ":"+ password;
String encoding  = new String (Base64.encode(user_Password.getBytes()));
String Authentication = "Basic " + encoding;

You might be able to do that backwards somehow....

Hope it helps
-reynir


> -----Original Message-----
> From: Abhishek Srivastava [mailto:absrivas@cisco.com] 
> Sent: 2. desember 2002 08:30
> To: tomcat-user@jakarta.apache.org
> Cc: Sunu Joseph
> Subject: Retrieving username and password from url??
> 
> 
> Hi,
> Is there a way that I can retrieve the username and password 
> from the url given as below using a servlet. 
> https://username:password@hostname/servletname> /servlet
> 
> 
> 
> Regards,
> Abhishek
> 
> 
> 
> 
> 
> 
> 
> 
> --
> To unsubscribe, 
> e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: 
> <mailto:tomcat-user-help@jakarta.apache.org>
> 
> 

--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message