Creating Acegi Users in a script

      No Comments on Creating Acegi Users in a script

We are using Acegi plugin for Authentication and Authorization in Grails. We had to create users in bulk using MySql script. We have to know the encrypted password for each user, corresponding to the clear text password to insert in the database. (Acegi encrypts the password before storing it in the database).

I came across this nice post http://stackoverflow.com/questions/1472431/acegi-password-encryption

I was also thinking that Acegi must be using MD5, but after reading this post realized that it is SHA1 encryption.

You can get the sha1 encrypted password by issuing this command

echo -n password | openssl sha1

For eg. if your password is admin you can find encrypted password by issuing this command

echo -n admin | openssl sha1

Leave a Reply

Your email address will not be published. Required fields are marked *