Ruby on Rails
Wednesday, October 2, 2013
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
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/c75790d5-e4e5-482e-8988-5ea1cbcdac08%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment