Loganathan Sellapa
2012-Sep-10 03:45 UTC
Authlogic: current user is nil, after adding http basic authentication in production environment
Hi All, I have implemented http basic authentication in my application, after the implementation of basic http authentication, current user is always nil in production mode. Pasted below my code for your reference. In Application controller: def authenticate_user if (Rails.env.production? && current_user_session.nil?) authenticate_or_request_with_http_basic do |username, password| username == HTTP_AUTHENTICATION_USERNAME && password =HTTP_AUTHENTICATION_PASSWORD end end end Where HTTP credentials are taken from initializer file. HTTP_AUTHENTICATION_USERNAME="xxxx" HTTP_AUTHENTICATION_PASSWORD="yyy" Also I tried "allow_http_basic_auth false" in user session model but it didn''t solve the problem. regards, Loganathan Mob: +91 7760780741 | +91 9944414388 Skype: loganathan.sellappa ViewMe <http://vizualize.me/loganathan> -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.