Sunday, 9 September 2012

Adding ssl for active admin

Hi,

I would like to provide complete admin section with ssl, which provides high level of security for the admin section. I am using active admin for my application. I have searched for available options and finally I have found a perfect match for my requirement. gem 'rack-ssl-enforcer' provides the required functionality for us.

gem 'rack-ssl-enforcer'

add the gem to your gem file and run the command 'bundle install' to install the gem.

You need to add the required configurations settings to make the admin section work with ssl.

Add the below line in the config/application.rb

config.middleware.use Rack::SslEnforcer, :only => %r{^/admin/}

Points to be observed from the above line.

1) We are adding 'Rack::SslEnforcer' as a middleware.
2) We are adding rule based ssl.

The above configuration will make the middleware to force the ssl for the constraint that was passed as condition to it. So it will aforce ssl to be applied for admin section.

To me about the gem 'rack-ssl-enforcer', go through the complete section of github URL: https://github.com/umamahesh/rack-ssl-enforcer

Thank You,
Uma Mahesh.

No comments:

Post a Comment