I’m using this to get login information from mod_ldap_auth – user is authenticated against Microsoft’s Active Directory (AD)
def getAuthenticated
if request.env['HTTP_AUTHORIZATION'] then
authdata = request.env['HTTP_AUTHORIZATION'].to_s.split
user,pass = Base64.decode64(authdata[1]).split(':')[0..1]
[ user, pass ]
else
[ "", "" ]
end
end