Unable to login using Shiro, specify correct credentials matcher


I recently ran into a issue where authentication failed using the Apache Shiro plugin for Grails. I discovered that my base standard setup was using Sha256 vs Sha512 for password encryption. Make sure when encrypting the password you are implementing the correct CredentialsMatcher.

If you would like to use a custom credentials matcher, specify it in your Spring resource.groovy. Below is an example

beans = {
  bean {
    credentialMatcher(Sha512CredentialsMatcher) {
      storedCredentialsHexEncoded = true
    }
  }
}

Advertisements

One thought on “Unable to login using Shiro, specify correct credentials matcher

  1. Peter Ledbrook

    Yes, I need to sort this out. I’m thinking of using a simliar approach to the Spring Security plugin, which has an injectable service for encoding passwords.

    Another issue is that the docs on the plugin portal must match different versions of the plugin. I really need to use gdoc.

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s