I have a modified User class in my spring security which use attribute email instead of username. Now I want to a functionality to switch users, so an admin can login seamlessly as a particular user without logging out. I came across this [Link](https://grails-plugins.github.io/grails-spring-security-core/guide/switchUser.html) , which shows there is a switchUserFilter to achieve this. So I tried to get it working by passing j\_username as email,but it gets redirected to a blank page and the user does not switch. 

I have tried all these things but still could not figure out a way around it:
1) Added to Config.groovy:
`grails.plugins.springsecurity.userLookup.usernamePropertyName='email`'

2) Create a method in User class getUserName() to return email.

P.S: I looked into the source code of springSecurity switchUserFilter([link](https://github.com/spring-projects/spring-security/blob/master/web/src/main/java/org/springframework/security/web/authentication/switchuser/SwitchUserFilter.java#L209))and came across this code on line 209:

```
protected Authentication attemptSwitchUser(HttpServletRequest request)
        throws AuthenticationException {
    UsernamePasswordAuthenticationToken targetUserRequest;

    String username = request.getParameter(usernameParameter);

```

But I am not sure if that is the issue and do not want to make changes in the plugin.