From: Brian Candler Date: 2012-03-21T06:57:38+09:00 Subject: Re: network user with sinatra Mario Ruiz wrote in post #1052356: > Robert Klemme wrote in post #1052335: >> Are you talking about a Windows domain login? I do not have too much >> insight into Windows authentication mechanisms but I doubt you can >> access user name from an ordinary HTTP request - at least not with >> additional efforts. >> > > it is like in Ruby using ENV['user'] or ENV['username'], work for linux > or windows Not from a web request it doesn't. If the user has to authenticate to your site (e.g. with HTTP Basic Auth), then you can get the username they authenticated with. This may or may not be related to their domain login. But if they just went to http://your.site/ and your site doesn't require authentication, then your site will just serve them the page and you won't know what Windows username they had. If they have a domain login, then it *might* be possible to set up your webserver to require Kerberos authentication and for the Windows client to present its domain Kerberos ticket as credentials. I don't know how feasible this is. I've done it with Unix krb5 clients but not with Windows clients. -- Posted via http://www.ruby-forum.com/.