Tuesday, 31 May 2011

Custom Password Encoder for Grails Spring-Security Plugin

The spring-security (core and others) plugin is very handy for incorporating user (and role) based functionalities for a grails application. The plugin comes with a lot of features out-of-the-box. And more often than not, some of the basic features can be used as is. However, there are occasions when a little bit of customization might be required.

In this project, I was required to use a custom password encryption algorithm. The spring-security plugin uses the 'SHA-256' algorithm by default. This can be changed to use other standard algorithms (MD2, MD5 etc.) by adding the following lines (if, for example, MD5 encoding is required) in /grails-app/conf/Config.groovy:
But what I wanted was to use a custom algorithm of our own, not the standard ones. Fortunately, this is again, very easy. Because of Spring's dependency injection, we can easily create our own password encoder and inject it. The steps to do the same are explained here.


  1. The multiplication of software m&a inside the innovation space has been the scenery for bargain movement in North America for a lot of 2019. In 2Q alone, the Information Technology industry represented 25.7% of arrangement esteem on account of a lift from programming and SaaS organizations.

  2. RTC is one of the first class Dental Center in Reston. It is safe to say that you are looking for family Reston Dentistry? Our profoundly qualified Dentists in Reston VA are here to push you to.

  3. Brand new UK film review is about the fantastic movie and most of people are waiting for this film. I also impatiently wait for this film and now uk assignment writing service to find out quality work. Thanks to post about it. I really appreciate to you and your work.

  4. Amazing Post I like your way of writing you describe it clear and easy to understand what you want to say great blogger keep it up. Masters Dissertation Help UK

  5. Accounting Coursework Writing Services are hard to come across for those in need of Accounting Writing Services and accounting essay writing services.

  6. No matter what application or program, users want to make sure their data is always safe before using it. Whenever you add a new plugin to the application or bring a new update, users should be notified in advance. Dissertation Proposal Writing Services


Copyright David Bourget and University of London, 2011. This blog's content is license under the Attribution-ShareAlike license.