Package com.mossle.security.impl

Examples of com.mossle.security.impl.SpringSecurityUserAuth


                    principal);

            return Collections.EMPTY_LIST;
        }

        SpringSecurityUserAuth springSecurityUserAuth = (SpringSecurityUserAuth) principal;

        List<String> roles = springSecurityUserAuth.getRoles();

        return roles;
    }
View Full Code Here


            logger.info("principal {} is not SpringSecurityUserAuth", principal);

            return null;
        }

        SpringSecurityUserAuth springSecurityUserAuth = (SpringSecurityUserAuth) principal;

        return springSecurityUserAuth;
    }
View Full Code Here

    /**
     * 取得当前用户的id,如果当前用户与未登录,则返回null.
     */
    public static String getCurrentUserId() {
        SpringSecurityUserAuth springSecurityUserAuth = getCurrentUser();

        if (springSecurityUserAuth == null) {
            return null;
        }

        return springSecurityUserAuth.getId();
    }
View Full Code Here

        if (debug) {
            return securityContext;
        }

        SpringSecurityUserAuth userAuthInSession = SpringSecurityUtils
                .getCurrentUser(securityContext);

        if (userAuthInSession == null) {
            logger.debug("userAuthInSession is null");

            return securityContext;
        }

        UserAuthDTO userAuthInCache = userAuthConnector.findById(
                userAuthInSession.getId(), userAuthInSession.getScopeId());

        SpringSecurityUserAuth userAuthResult = new SpringSecurityUserAuth();
        beanMapper.copy(userAuthInCache, userAuthResult);

        SpringSecurityUtils.saveUserDetailsToContext(userAuthResult, null,
                securityContext);
View Full Code Here

    public UserDetails loadUserByUsername(String username)
            throws UsernameNotFoundException {
        logger.debug("username : {}", username);

        if (debug) {
            SpringSecurityUserAuth userAuth = new SpringSecurityUserAuth();
            userAuth.setId("1");
            userAuth.setUsername(username);
            userAuth.setDisplayName(username);
            userAuth.setPermissions(Collections.singletonList("*"));

            return userAuth;
        }

        try {
            UserAuthDTO userAuthDto = userAuthConnector.findByUsername(
                    username, ScopeHolder.getScopeId());

            SpringSecurityUserAuth userAuthResult = new SpringSecurityUserAuth();
            beanMapper.copy(userAuthDto, userAuthResult);

            if (defaultPassword != null) {
                userAuthResult.setPassword(defaultPassword);
            }

            return userAuthResult;
        } catch (Exception ex) {
            logger.error(ex.getMessage(), ex);
View Full Code Here

TOP

Related Classes of com.mossle.security.impl.SpringSecurityUserAuth

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.