Package com.mobius.model

Examples of com.mobius.model.MyAuthenticationToken


                template.setDescription(rtemplate.getDescription());
                SecurityContext context = SecurityContextHolder.getContext();
                Authentication authentication = context.getAuthentication();
                String username = "";
                if (authentication instanceof MyAuthenticationToken) {
                    MyAuthenticationToken authenticationToken = (MyAuthenticationToken) authentication;
                    username = authenticationToken.getMyUser().getDomainName();
                }
                template.setModifiedBy(username);
                em.persist(template);
                em.getTransaction().commit();
            } else {
                template = new TblEFromTemplateE();
                template.setName(rtemplate.getName());
                template.setVersion(rtemplate.getVersion());
                template.setTemplateData(rtemplate.getJson());
                template.setModifiedOn(new Timestamp(new Date().getTime()));
                template.setDisplayName(rtemplate.getDisplayName());
                template.setDescription(rtemplate.getDescription());
                SecurityContext context = SecurityContextHolder.getContext();
                Authentication authentication = context.getAuthentication();
                String username = "";
                if (authentication instanceof MyAuthenticationToken) {
                    MyAuthenticationToken authenticationToken = (MyAuthenticationToken) authentication;
                    username = authenticationToken.getMyUser().getDomainName();
                }
                template.setModifiedBy(username);
                em.persist(template);
                em.getTransaction().commit();
                em.refresh(template);
View Full Code Here


        }
        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 {
            return null;
        }
    }
View Full Code Here

TOP

Related Classes of com.mobius.model.MyAuthenticationToken

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.