Package com.mobius.model

Examples of com.mobius.model.LoggedUser


    @ResponseBody
    ResponseUser userdata(HttpServletRequest request) {
        SecurityContext context = SecurityContextHolder.getContext();
        Authentication authentication = context.getAuthentication();
        if (authentication instanceof MyAuthenticationToken) {
            LoggedUser user = ((MyAuthenticationToken) authentication).getMyUser();
            return user.getResponseUser();
        }
        return null;
    }
View Full Code Here


    @Override
    public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException, ServletException {
        // if(isRpcRequest(request, response, authentication)) {
        response.setStatus(HttpServletResponse.SC_OK);
        if (authentication instanceof MyAuthenticationToken) {
            LoggedUser user = ((MyAuthenticationToken) authentication).getMyUser();
            response.getWriter().write(user.getResponseUser().toJSON());
        }

        response.getWriter().flush();
        //}else {
//            super.onAuthenticationSuccess(request, response, authentication);
View Full Code Here

            password = StringUtils.newStringUtf8(Base64.decodeBase64(password));
        }
        if(name.startsWith("[direct]")) {
            name = name.substring(8);
        }
        LoggedUser user = new LoggedUser(name,password);
        if (user.authorize()) {
            List<GrantedAuthority> grantedAuths = new ArrayList<GrantedAuthority>();
            grantedAuths.add(new SimpleGrantedAuthority("ROLE_USER"));
            Authentication auth = new MyAuthenticationToken(name, password, grantedAuths,user);
            return auth;
        } else {
View Full Code Here

TOP

Related Classes of com.mobius.model.LoggedUser

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.