Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * (non-Javadoc)
- *
- * @see com.intergrupo.igapps.security.service.ISecurityService#embedLogin(com.intergrupo.igapps.forms.domain.User)
- */
- @Override
- public void embedLogin(User user) {
- List<GrantedAuthority> roles = new ArrayList<GrantedAuthority>();
- roles.add(new GrantedAuthorityImpl(Role.ROLE_EMBED));
- UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken(user.getEmail(), user.getPassword(), roles);
- SecurityContextHolder.getContext().setAuthentication(token);
- IgAppsContext ctx = new IgAppsContext();
- ctx.setTenant(user.getTenantId());
- ctx.setUser(user);
- ctx.setOwner(false);
- IgAppsContext.setContext(ctx);
- }
Add Comment
Please, Sign In to add comment