Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

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.

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.