(Quick Reference)

9 Authentication Providers - Reference Documentation

Authors: Burt Beckwith, Beverley Talbott

Version: 2.0.0

9 Authentication Providers

The plugin registers authentication providers that perform authentication by implementing the AuthenticationProvider interface.

PropertyDefault ValueMeaning
providerNames['daoAuthenticationProvider', 'anonymousAuthenticationProvider', 'rememberMeAuthenticationProvider']Bean names of authentication providers.

Use daoAuthenticationProvider to authenticate using the User and Role database tables, rememberMeAuthenticationProvider to log in with a rememberMe cookie, and anonymousAuthenticationProvider to create an 'anonymous' authentication if no other provider authenticates.

To customize this list, you define a providerNames attribute with a list of bean names. The beans must be declared either by the plugin, or yourself in resources.groovy or resources.xml. Suppose you have a custom MyAuthenticationProvider in resources.groovy:

beans = {
   myAuthenticationProvider(com.foo.MyAuthenticationProvider) {
      // attributes
   }
}

You register the provider in grails-app/conf/Config.groovy as:

grails.plugin.springsecurity.providerNames = [
   'myAuthenticationProvider',
   'anonymousAuthenticationProvider',
   'rememberMeAuthenticationProvider']