You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Natalie Wang <my...@yahoo.com> on 2007/12/21 22:21:12 UTC

Tomcat 6 getRemoteUser() returns null

Hi,

We have to retrieve the userid of the remote user when
the user logs on. But request.getRemoteUser() is
returning null in Tomcat 6. Authentication is done
through LDAP.

It works fine in Tomcat 5 and 4.

Any suggestion?

Thanks,
Natalie


      ____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat 6 getRemoteUser() returns null

Posted by Natalie Wang <my...@yahoo.com>.
Thank you for all the help.

It is a configuration problem.

I use apache and webauth to do the authentication.
in tomcat server.xml, I need to set
tomcatAuthentication="false" which I did not do it.

<Connector protocol="AJP/1.3" port="..."  ...
tomcatAuthentication="false"  />

Thanks,
Natalie
 
--- Mark Thomas <ma...@apache.org> wrote:

> Natalie Wang wrote:
> > It does not work either.
> 
> Tomcat version?
> Java version?
> OS and version?
> LDAP and version?
> Errors in logs?
> Extracts from relevant configuration files?
> 
> Have you tried this with a simple test case? Ie a
> single html file and a
> resource constraint? Does the same test work if you
> use the memory realm?
> 
> Mark
> 
> 
>
---------------------------------------------------------------------
> To start a new topic, e-mail:
> users@tomcat.apache.org
> To unsubscribe, e-mail:
> users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail:
> users-help@tomcat.apache.org
> 
> 



      ____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat 6 getRemoteUser() returns null

Posted by Mark Thomas <ma...@apache.org>.
Natalie Wang wrote:
> It does not work either.

Tomcat version?
Java version?
OS and version?
LDAP and version?
Errors in logs?
Extracts from relevant configuration files?

Have you tried this with a simple test case? Ie a single html file and a
resource constraint? Does the same test work if you use the memory realm?

Mark


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat 6 getRemoteUser() returns null

Posted by Gabe Wong <ga...@ngasi.com>.
Natalie Wang wrote:
> It does not work either.
>
> Thanks,
> Natalie
>
> --- Gabe Wong <ga...@ngasi.com> wrote:
>
>   
>> Natalie Wang wrote:
>>     
>>> Hi,
>>>
>>> We have to retrieve the userid of the remote user
>>>       
>> when
>>     
>>> the user logs on. But request.getRemoteUser() is
>>> returning null in Tomcat 6. Authentication is done
>>> through LDAP.
>>>
>>> It works fine in Tomcat 5 and 4.
>>>
>>> Any suggestion?
>>>
>>> Thanks,
>>> Natalie
>>>
>>>   
>>>       
>> This me be an issue with the Web Framework your
>> application might by using.
>> Try the following code:
>>             String r = request.getRemoteUser();
>>             if (r == null)
>>              {
>>                  java.security.Principal pr = 
>> request.getUserPrincipal();
>>                 if (pr != null){
>>                 r = pr.getName();
>>                 }
>>             }
>>
>>     

After the user logs in, is the user being redirected to another resource 
or is the user being forwarded?
Also are you using some Web Framework?

-- 
Regards

Gabe Wong
NGASI AppServer Manager
Application server installation and configuration AUTOMATION
http://www.ngasi.com


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat 6 getRemoteUser() returns null

Posted by Natalie Wang <my...@yahoo.com>.
It does not work either.

Thanks,
Natalie

--- Gabe Wong <ga...@ngasi.com> wrote:

> Natalie Wang wrote:
> > Hi,
> >
> > We have to retrieve the userid of the remote user
> when
> > the user logs on. But request.getRemoteUser() is
> > returning null in Tomcat 6. Authentication is done
> > through LDAP.
> >
> > It works fine in Tomcat 5 and 4.
> >
> > Any suggestion?
> >
> > Thanks,
> > Natalie
> >
> >   
> This me be an issue with the Web Framework your
> application might by using.
> Try the following code:
>             String r = request.getRemoteUser();
>             if (r == null)
>              {
>                  java.security.Principal pr = 
> request.getUserPrincipal();
>                 if (pr != null){
>                 r = pr.getName();
>                 }
>             }
> 
> -- 
> Regards
> 
> Gabe Wong
> NGASI AppServer Manager
> Application server installation and configuration
> AUTOMATION
> http://www.ngasi.com
> 
> 
>
---------------------------------------------------------------------
> To start a new topic, e-mail:
> users@tomcat.apache.org
> To unsubscribe, e-mail:
> users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail:
> users-help@tomcat.apache.org
> 
> 



      ____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat 6 getRemoteUser() returns null

Posted by Gabe Wong <ga...@ngasi.com>.
Natalie Wang wrote:
> Hi,
>
> We have to retrieve the userid of the remote user when
> the user logs on. But request.getRemoteUser() is
> returning null in Tomcat 6. Authentication is done
> through LDAP.
>
> It works fine in Tomcat 5 and 4.
>
> Any suggestion?
>
> Thanks,
> Natalie
>
>   
This me be an issue with the Web Framework your application might by using.
Try the following code:
            String r = request.getRemoteUser();
            if (r == null)
             {
                 java.security.Principal pr =  request.getUserPrincipal();
                if (pr != null){
                r = pr.getName();
                }
            }

-- 
Regards

Gabe Wong
NGASI AppServer Manager
Application server installation and configuration AUTOMATION
http://www.ngasi.com


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org