« Return to Thread: Bootstrap issue with Acegi

Re: Bootstrap issue with Acegi

by garbandi :: Rate this Message:

Reply to Author | View in Thread

just a minor improvement

since the hashing-algorithm is a configurable item in the acegy config,
maybe you should not use DigestUtils, but instead rely on acegi's
authenticateService.

you could add

        def authenticateService

to your BootStrap class. then you should be able to replace

        def md5pass = DU.md5Hex("pass")

with
       
        def md5pass = authenticateService.passwordEncoder("pass")


i prefer to go one step further and put this stuff into a method
"changePassword " to my User class.
       
then my bootstrap-code looks like:
        def user = new User(....).changePassword("pass").save()

regards,
        andi

 « Return to Thread: Bootstrap issue with Acegi