Is it possible for a rails web application to make use of the windows authentication features in its code. I am looking at being able to obtain the user's login name and domain in the application. But there is a catch.
This particular web application runs off an apache web server hosted on a linux machine which is kind of networked to other windows machines.
Is all of this possible?
You can use
mod_auth_sspi
with Apache to enable NTLM authentication (have a look at this post).Another way to do it with Basic authentication is with the
mod_authnz_ldap
to enable LDAP authentication (Basic authentication) in Apache which will allow it to talk to Active Directory for authentication.If you are using Apache, then, yes, you should be able to achieve that. First, portect the directory your Rails app lives with Apache, using LDAP/Kerberos (aka Active Directory) - this link describes what you've got to do.
After you are done with that, in your Rails app, the name of the Kerberos principal that logged in should be available in the environment vairable REMOTE_USER.