You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Vibhor Kumar Agarwal <vi...@rediffmail.com> on 2011/07/27 10:10:46 UTC

Finding user name without authentication

Hello Folks,

Looking for an option to find the user name opening the web server portal.
Don't want to authenticate via LDAP, NIS, etc.

Does the web server know the login id of windows?

Thanks in advance.
-- 
View this message in context: http://old.nabble.com/Finding-user-name-without-authentication-tp32146111p32146111.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


Re: Finding user name without authentication

Posted by Vibhor Kumar Agarwal <vi...@rediffmail.com>.


> Addendum :
> 
> In the above, I was assuming
> a) that the webserver you are talking about is Tomcat
> b) that you mean a configuration where Tomcat is accessed directly by the
> user browser (as 
>   opposed to a configuration where Tomcat is behind some other front-end
> system).
> 
> In case (b), there are also methods to authenticate the user at the
> front-end level, and 
> pass this authentication to Tomcat inside each forwarded request.
> 
> 

Sorry folks for being late.
Could you please clarify the above options.

Scenario:
Tomcat is running on FreeBSD.
End user can use any browser & OS combination to access HTML pages hosted by
tomcat.
-- 
View this message in context: http://old.nabble.com/Finding-user-name-without-authentication-tp32146111p32184387.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


Re: Finding user name without authentication

Posted by André Warnier <aw...@ice-sa.com>.
Vibhor Kumar Agarwal wrote:
> Hello Folks,
> 
> Looking for an option to find the user name opening the web server portal.
> Don't want to authenticate via LDAP, NIS, etc.
> 
> Does the web server know the login id of windows?
> 

The way you phrase things above is self-contradictory, because

1) The /only/ way by which the webserver would know the user-id is by doing /some kind/ of
authentication.
(Another way to say this : if the webserver does not do any kind of authentication, then
it does not know the user-id).

2) As authentication /method/, you can choose between different mechanisms :
- a login page
- LDAP
- NIS
- ...
and
- Windows Domain authentication

3) If you want the webserver to authenticate the user by his Windows Domain login, then
you must use the last option above.
There are several ways of implementing this (*), and also pre-requisites for this to work
(for example, the webserver will generally need to be itself "inside the domain" to able
to do this kind of user authentication).

(*) Have a look at http://tomcat.apache.org/tomcat-7.0-doc/windows-auth-howto.html,
and also at http://www.ioplex.com/jespa.html (commercial).

Addendum :

In the above, I was assuming
a) that the webserver you are talking about is Tomcat
b) that you mean a configuration where Tomcat is accessed directly by the user browser (as 
  opposed to a configuration where Tomcat is behind some other front-end system).

In case (b), there are also methods to authenticate the user at the front-end level, and 
pass this authentication to Tomcat inside each forwarded request.


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


Re: Finding user name without authentication

Posted by André Warnier <aw...@ice-sa.com>.
Vibhor Kumar Agarwal wrote:
> Thanks for the replies,
> Forgot to mention the page can be run from Windows or Unix. In fact any OS.
> 
> Not a well versed person with web server & NIS.
> Suggestions given above seem to be applicable for Windows only or will work
> for any OS?

Except for the code which Joseph sent earlier, the other stuff you have been pointed to 
will work under any OS under which Tomcat is running.
But for NTLM (or SPNEGO or WIA or whatever other names are given to Windows-style 
authentication) they generally require that the Tomcat server itself, be inside the same 
network as the users' workstations; and also that the Tomcat server has network access to 
a Windows Domain Controller.
That is usually the case when you are considering this type of authentication. But for 
example it will not work if the workstations are inside a company's network, and the 
Tomcat server is outside the intranet, on the WWW for instance.


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


Re: Finding user name without authentication

Posted by Vibhor Kumar Agarwal <vi...@rediffmail.com>.
Thanks for the replies,
Forgot to mention the page can be run from Windows or Unix. In fact any OS.

Not a well versed person with web server & NIS.
Suggestions given above seem to be applicable for Windows only or will work
for any OS?
-- 
View this message in context: http://old.nabble.com/Finding-user-name-without-authentication-tp32146111p32146570.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


Re: Finding user name without authentication

Posted by Mark Thomas <ma...@apache.org>.
On 27/07/2011 09:10, Vibhor Kumar Agarwal wrote:
> Hello Folks,
> 
> Looking for an option to find the user name opening the web server portal.
> Don't want to authenticate via LDAP, NIS, etc.

That is logically impossible. If a client hasn't authenticated there is
no user associated with the request and therefore no user name.

> Does the web server know the login id of windows?

Windows is an operating system. It doesn't have a have a "login id".
Users (and other entities) do. I assume you mean "Does Tomcat know the
Windows user name of the user making the current request?". Again,
simply not possible without authentication.

The closest you'll get to what you are looking for is this:
http://tomcat.apache.org/tomcat-7.0-doc/windows-auth-howto.html

Mark



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


Re: Finding user name without authentication

Posted by Chema <de...@gmail.com>.
2011/7/27 Vibhor Kumar Agarwal <vi...@rediffmail.com>:

> Does the web server know the login id of windows?
>
> Thanks in advance.

Windows OS ?
You can look at

http://tomcat.apache.org/tomcat-7.0-doc/windows-auth-howto.html

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


Re: Finding user name without authentication

Posted by André Warnier <aw...@ice-sa.com>.
Vibhor Kumar Agarwal wrote:
> Hello Folks,
> 
> Looking for an option to find the user name opening the web server portal.
> Don't want to authenticate via LDAP, NIS, etc.
> 
> Does the web server know the login id of windows?
> 

The way you phrase things above is self-contradictory, because

1) The /only/ way by which the webserver would know the user-id is by doing /some kind/ of 
authentication.
(Another way to say this : if the webserver does not do any kind of authentication, then 
it does not know the user-id).

2) As authentication /method/, you can choose between different mechanisms :
- a login page
- LDAP
- NIS
- ...
and
- Windows Domain authentication

3) If you want the webserver to authenticate the user by his Windows Domain login, then 
you must use the last option above.
There are several ways of implementing this (*), and also pre-requisites for this to work 
(for example, the webserver will generally need to be itself "inside the domain" to able 
to do this kind of user authentication).

(*) Have a look at http://tomcat.apache.org/tomcat-7.0-doc/windows-auth-howto.html,
and also at http://www.ioplex.com/jespa.html (commercial).

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


Re: Finding user name without authentication

Posted by Joseph <wu...@gmail.com>.
like this ?


var wshshell=new ActiveXObject("wscript.shell");
var username=wshshell.ExpandEnvironmentStrings("%username%");


2011/7/27 Vibhor Kumar Agarwal <vi...@rediffmail.com>

>
> Hello Folks,
>
> Looking for an option to find the user name opening the web server portal.
> Don't want to authenticate via LDAP, NIS, etc.
>
> Does the web server know the login id of windows?
>
> Thanks in advance.
> --
> View this message in context:
> http://old.nabble.com/Finding-user-name-without-authentication-tp32146111p32146111.html
> Sent from the Tomcat - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


-- 
Never trust your computer.