I'd like to require ssl authentication for the user resource on devise. I was expecting that to be as simple as it is in rails, like:
devise_for :users, :constraints => { :protocol => "https" }
Also, I couldn't find any documentation on devise's github, though I've found some dead links pointing to it at the google groups.
Does anybody has a hint on how to get it working easily? I thought I'd be simple, given the popularity of the plugin
Under Install and Manage SSL for your site (HTTPS), click Manage SSL Sites. Scroll down to the Install an SSL Website and click Browse Certificates. Select the certificate that you want to activate and click Use Certificate. This will auto-fill the fields for the certificate.
For most browsers, look to see if a site URL begins with “https,” which indicates it has an SSL certificate. Then click on the padlock icon in the address bar to view the certificate information.
:constraints won't work as option, but this probably will:
constraints :protocol => "https" do
devise_for :users
end
Integrate SSL Requirement into your app and using Devise. The answer didn't work but this did for me, especially since I was using SSL Requirement already.
I suggest using Rack::SSL, maybe with Rack::SslEnforcer for more configuration options.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With