classes.org.grails.plugins.springsecurity.service
Class AuthenticateService

Authentication utility methods.

author:
T.Yamamoto
author:
Burt Beckwith

Field Summary
 def passwordEncoder
           
 def securityConfig
           
 boolean transactional
           
 
Constructor Summary
AuthenticateService()
           
 
Method Summary
String encodePassword(String passwd)
          
ConfigObject getSecurityConfig()
           Load the security configuration.
boolean ifAllGranted(def role)
           dependency injection for the password encoder
boolean ifAnyGranted(def role)
          
boolean ifNotGranted(def role)
          
boolean isAjax(def request)
           Check if the request was triggered by an Ajax call.
boolean isLoggedIn()
          
String passwordEncoder(String passwd)
           returns a MessageDigest password.
def principal()
           Get the currently logged in user's principal.
def userDomain()
           Get the currently logged in user's domain class.
 

Constructor Detail

AuthenticateService

AuthenticateService()


Method Detail

encodePassword

String encodePassword(String passwd)


getSecurityConfig

ConfigObject getSecurityConfig()
Load the security configuration.
return:
the config


ifAllGranted

boolean ifAllGranted(def role)
dependency injection for the password encoder


ifAnyGranted

boolean ifAnyGranted(def role)
deprecated:
You can invoke tags from controllers (since grails-0.6)


ifNotGranted

boolean ifNotGranted(def role)
deprecated:
You can invoke tags from controllers (since grails-0.6)


isAjax

boolean isAjax(def request)
Check if the request was triggered by an Ajax call.
param:
request the request
return:
true if Ajax


isLoggedIn

boolean isLoggedIn()


passwordEncoder

String passwordEncoder(String passwd)
returns a MessageDigest password. (changes algorithm method dynamically by param of config)
deprecated:
use encodePassword instead


principal

public def principal()
Get the currently logged in user's principal.
return:
the principal or null if not logged in


userDomain

public def userDomain()
Get the currently logged in user's domain class.
return:
the domain object or null if not logged in