Grails : login fails on upgrading shiro plugin.
We are in the process of upgrading our pre 2.0 Grails app to version 2.1.0. This propelled us to update many of the used plugins. One of them was Shiro plugin. We upgraded it from 1.0.1 to 1.1.4. On upgrading the plugin our login attempts were consistently failing, the reason being, this version uses Sha512Hash and with older version 1.0.1 we used Sha1Hash. We needed to make sure that all users were still able to login without having to change their passwords.
On reading plugin page again we found that credential Matcher used by shiroPlugin can be reconfigured to use other algorithms also by creating a bean in file named “resource.groovy”. And that is exactly what we did and our login was working again.
[java]
credentialMatcher(Sha1CredentialsMatcher) {
storedCredentialsHexEncoded = true
}
[/java]
storedCredentialsHexEncoded = true, this line tells that passwords are encoded to hex before they are stored.