vaadin with spring security LDAP

Hi team,

i am able to achieve vaadin with spring security which is using LDAP, but once the user logs in how to save the information in session object for later usage of my application to store in to DB.

the below is the class which i am using (every time once the user loggin in the class will be called )

public class CustomUserDetailsContextMapper implements UserDetailsContextMapper {

static final Logger LOGGER = LoggerFactory.getLogger(CustomUserDetailsContextMapper.class);

[color=#FFA07A]

@Override
public UserDetails mapUserFromContext(DirContextOperations ctx, String username, Collection<? extends GrantedAuthority> authority) {

    List<GrantedAuthority> mappedAuthorities = new ArrayList<GrantedAuthority>();

    boolean isRunningOnProductionServer = false;
    try {
        isRunningOnProductionServer = InetAddress.getLocalHost().getHostName().toUpperCase().equals("XYZ");
    } catch (UnknownHostException e1) {
        LOGGER.error(e1.getMessage());
    }

    if (isRunningOnProductionServer) {
        for (GrantedAuthority granted : authority) {
            grantAuthoritiesProd(granted, mappedAuthorities);
        }
    } else {
        for (GrantedAuthority granted : authority) {
            grantAuthoritiesTest(granted, mappedAuthorities);
        }
    }

    List<String> grantedAuthorities = new ArrayList<String>();
    for (GrantedAuthority grantedAuthority : mappedAuthorities) {
        grantedAuthorities.add(grantedAuthority.getAuthority());
    }

    UUID uuid = assignRandomUUID();

    LOGGER.info("Authenticating user: " + username + " >>> UUID: " + uuid + " >>> Granted Authorities: " + grantedAuthorities);

    return new User(

[/color]

username

[color=#FFA07A]
, “”, true, true, true, true, mappedAuthorities);
}

and the spring confi file
[/color]

[color=#0000FF]

<?xml version="1.0" encoding="UTF-8"?>

<security:global-method-security secured-annotations="enabled" />

<security:http auto-config="true" use-expressions="true" disable-url-rewriting="true">
    <security:access-denied-handler ref="customAccessDeniedHandler" />
    <security:intercept-url pattern="/**" access="hasAnyRole('ROLE1', 'ROLE2')" />
    <security:logout success-handler-ref="logoutSuccessHandler" invalidate-session="true" logout-url="/logout" />
</security:http>

<security:authentication-manager>
    <security:authentication-provider ref="activeDirectoryAuthenticationProvider" />
</security:authentication-manager>

<bean id="activeDirectoryAuthenticationProvider" class="org.springframework.security.ldap.authentication.ad.ActiveDirectoryLdapAuthenticationProvider">
    <constructor-arg value="confidential" />
    <constructor-arg value="conidential" />
    <property name="userDetailsContextMapper" ref="customUserDetailsContextMapper" />
    <property name="convertSubErrorCodesToExceptions" value="true" />
</bean>

<bean id="customAccessDeniedHandler" class="com.hm.online.accounting.transactiontypemanager.web.session.CustomAccessDeniedHandler">
    <property name="accessDeniedUrl" value="logout" />
</bean>

<bean id="customUserDetailsContextMapper" class="com.hm.online.accounting.transactiontypemanager.web.session.CustomUserDetailsContextMapper" />

Any help , how to put in session object
[/color]