Impersonate user (Switch to other user) functionality not working after closing browser

189 Views Asked by At

I am unable to login as another user (Impersonate) once after closing the browser. Here are my config settings

build.gradle

compile 'org.grails.plugins:spring-security-core:3.2.3'

Gsp:

<g:link uri="${request.contextPath}/login/impersonate?username=${s.username}" >Switch user</g:link>

application.groovy:

grails.plugin.springsecurity.useSwitchUserFilter = true
grails.plugin.springsecurity.controllerAnnotations.staticRules = [
    [pattern: '/login/impersonate', access: ['ROLE_ADMIN','IS_AUTHENTICATED_FULLY'] ],
    [pattern: '/**',             access: ['permitAll']]
    ....
    ]

Error Screen:

enter image description here

Note: I have done with POST call as well, but still I am facing same issue.

1

There are 1 best solutions below

0
kambalapalli Mahesh On

By removing 'IS_AUTHENTICATED_FULLY' from [pattern: '/login/impersonate', access: ['ROLE_ADMIN'] ] then it works.