Package org.encuestame.core.security.details

Examples of org.encuestame.core.security.details.EnMeSocialUserAccount


     */
    public static EnMeSocialUserAccount convertUserAccountToUserDetails(final SocialAccount connection) {
        final UserAccount user = connection.getUserOwner();
        final Collection<GrantedAuthority> authorities = new ArrayList<GrantedAuthority>();
        authorities.addAll(ConvertDomainsToSecurityContext.convertEnMePermission(user.getSecUserPermissions()));
        final EnMeSocialUserAccount enMeSocialUserAccount = new EnMeSocialUserAccount(user.getUsername(),
                authorities,
                user.isUserStatus() == null ? false : user.isUserStatus(),
                true, // account not expired
                true, // credentials not expired
                true, // account not locked
View Full Code Here


        log.trace("Register SOCIAL LOGIN USER: " + account.getUsername());
        // building granted authorities
        final Collection<GrantedAuthority> authorities = ConvertDomainsToSecurityContext
                .convertEnMePermission(account.getSecUserPermissions());
        // create user detail based on user account.
        final EnMeSocialUserAccount details = SecurityUtils.convertUserAccountToUserDetails(accountConnection);
        // set the social credentials permission.
        details.setSocialCredentials(true);
        final SocialAuthenticationToken token = new SocialAuthenticationToken(details, authorities);
        token.setProfileId(accountConnection.getSocialProfileId());
        token.setProvider(accountConnection.getAccounType());
        //clear the context.
        SecurityContextHolder.clearContext();
View Full Code Here

TOP

Related Classes of org.encuestame.core.security.details.EnMeSocialUserAccount

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.