I am using spring based authentication by implementing UserDetailsService. Following is my spring config

```
<authentication-manager>
    <authentication-provider user-service-ref="authenticationService">
        <password-encoder ref="passwordEncoder">
            <salt-source ref="authenticationService"/>
        </password-encoder>
    </authentication-provider>
</authentication-manager>

```

My authentication service looks like:

```
public class AuthenticationServiceImpl implements AuthenticationService, UserDetailsService, SaltSource {
    ....
    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException, DataAccessException { 
        ....
        return new org.springframework.security.core.userdetails.User(username, user.getPassword(), true, true, true, true, authorities);
    }
 }

```

Now the problem is when I create a new thread from one of my spring controllers. How do I authenticate my user in that thread ?