Package at.riemers.zero.base.model

Examples of at.riemers.zero.base.model.SpringUserDetails


            User user = userDao.getUser(username);
            if (user == null) {
                throw new UsernameNotFoundException("");
            }
            log.debug("user="+user.getUsername());
            return new SpringUserDetails((ZeroUser) user);
        } catch (Exception ex) {
            log.info("load user failed", ex);
            throw new UsernameNotFoundException(ex.getMessage());
        }
    }
View Full Code Here


            HttpServletRequest request) throws Exception {
        ZeroUser admin = (ZeroUser) session.getAttribute(UserModule.SESSION_LOGIN_AS_ADMIN);
        if (admin != null) {
            session.removeAttribute(UserModule.SESSION_LOGIN_AS_ADMIN);
            ZeroUser selectedUser = userDao.findById(admin.getId());
            SpringUserDetails userDetails = new SpringUserDetails(selectedUser);
            UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken(userDetails, selectedUser.getPassword());

            SecurityContextHolder.getContext().setAuthentication(token);
            session.removeAttribute("zero_componentManager");
            session.removeAttribute(ZeroConstants.MENU_KEY);
View Full Code Here

            HttpServletRequest request) throws Exception {
        if (checkAuthorisation(UserModule.AUTH_LOGIN_AS)) {

            session.setAttribute(UserModule.SESSION_LOGIN_AS_ADMIN, getUser());
            ZeroUser selectedUser = userDao.findById(selected);
            SpringUserDetails userDetails = new SpringUserDetails(selectedUser);
            UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken(userDetails, selectedUser.getPassword());

            SecurityContextHolder.getContext().setAuthentication(token);
            session.removeAttribute("zero_componentManager");
            session.removeAttribute(ZeroConstants.MENU_KEY);
View Full Code Here

TOP

Related Classes of at.riemers.zero.base.model.SpringUserDetails

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.