Grails Acegi: Ajax redirect, not a web page. What for?

I am using Acegi with grails, but I have a redirect problem.

I define in UrlMapping this:

"/" { 
  controller = "mycontroller"
  action = "myaction"
}

In mycontroller:

myaction = {
    if (authenticateService.isLoggedIn(){ "/mycontext/public" }
    else {
       // pseudo code
       if (role = ROLE_1) {
           redirect "/mycontext/myactionforNormalUser"
       }
       else if (role = ROLE_ADMIN) {
           redirect "/mycontext/myactionforROLEADMIN"
       }
    }
}

If I go to my application without logging in, I’m redirected to a public page, so that’s correct. But when I log in to the admin, I am redirected to auth / deniedAjax (from acegi), and not to my page. And if I log in as a regular user, I redirect to the ajax define method in my gsp.

Do you have an idea?

Many thanks.

+3
source share
1 answer

Upgraded and working now with spring security

0
source

All Articles