Forum: Ruby on Rails Get username of currently logged windows user.

5d3dbc813c3d4ed03fc0fc1ed49bc728?d=identicon&s=25 ihorse rails (Guest)
on 2013-10-01 17:22
(Received via mailing list)
Hi Folks,

Good Evening,

I want to get username of currently logged windows user. is it
possible??

If Possible.. please attach the sample code for more reference.

Please advise.

Thanks&Regards,
Ashokkumar
Fde839db701c9efdfb1b30823b9a2cc8?d=identicon&s=25 Robert O'Connor (Guest)
on 2013-10-01 17:25
(Received via mailing list)
System properties.

--rob
Sent from my cell...excuse typos
6883e5ef03484d4fcef507d7b4f1d243?d=identicon&s=25 Matt Jones (Guest)
on 2013-10-02 14:44
(Received via mailing list)
On Monday, 30 September 2013 05:14:32 UTC-5, ihorse rails wrote:
>
> Hi Folks,
>
> Good Evening,
>
> I want to get username of currently logged windows user. is it possible??
>
>
Currently logged in where, exactly? It's certainly not going to be
available from a web browser session under most circumstances. There's
NTLM
authentication which can do this, but it only works if the user has
marked
the site requesting it as "trusted".

Some Googling for "ntlm authentication rails" turned up a couple gems:

https://github.com/lukefx/rack-ntlm
https://github.com/rekado/ntlm-sso

Note that both projects are pretty thinly maintained; depending on the
Rails version you're targeting, you may need to roll your own solution
instead.

Also note that NTLM hands you information that is totally under the
end-user's control: you'll need to verify the information with an Active
Directory server if you  want to have any confidence in the values.
rack-ntlm appears to do this, but ntlm-sso does *not*.



> If Possible.. please attach the sample code for more reference.
>

That's not really how this list works: you'll get a much better response
if
you can say, "here's what I've tried, and this is how it's not working"
instead of "GIVE ME CODEZ PLZ".

--Matt Jones
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.