Examples of EnMeUserAccountDetails


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

            authorities.addAll(ConvertDomainsToSecurityContext.convertEnMePermission(user.getSecUserPermissions()));
           // log.debug("EnMeUserDetails: Authorities size :"+authorities.size());
        }

         //creating user details
         final EnMeUserAccountDetails userDetails = new EnMeUserAccountDetails(
         user.getUsername(),
         user.getPassword(),
         authorities,
         user.isUserStatus() == null ? false : user.isUserStatus(),
         true, // account not expired
         true, // credentials not expired
         true, // account not locked
         user.getCompleteName() == null ? "" : user.getCompleteName(), // complete name
         user.getUserEmail(), // user email
         user
         );
         userDetails.setSocialCredentials(false);
         userDetails.setAccountNonExpired(true);
         userDetails.setAccountNonLocked(true);
         //log.debug("EnMeUserDetails : "+userDetails.toString());
         return userDetails;
    }
View Full Code Here

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

    /**
     * Authenticate {@link UserAccount}.
     * @param account {@link UserAccount}.
     */
    public static void authenticate(final UserAccount account){
        final EnMeUserAccountDetails details = SecurityUtils.convertUserAccountToUserDetails(account, true);
        //log.debug("+++++++++++ authenticate +++++++++++++");
        //final Collection<GrantedAuthority> authorities = ConvertDomainsToSecurityContext
        //.convertEnMePermission(account.getSecUserPermissions());
        final EnMeSecurityToken securityToken = new EnMeSecurityToken(account);
         //clear the context.
View Full Code Here

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

     * Get logged {@link UserAccount}.
     * @return {@link UserAccount}.
     */
    public UserAccount getUserAccountonSecurityContext(){
        UserAccount account = null;
        final EnMeUserAccountDetails details = getSecurityDetails();
        if (details != null) {
            account = details.getUserAccount();
            if (log.isDebugEnabled()) {
                log.debug("info logged user account: "+account);
                if (account != null) {
                    log.debug("info logged user account: "+ account.getUserEmail());
                    log.debug("info logged user account: "+ account.getUsername());
View Full Code Here

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

            final Boolean socialSignIn){
         log.info("Register login user: "+ account.getUsername());
         //building granted authorities
         final Collection<GrantedAuthority> authorities = ConvertDomainsToSecurityContext.convertEnMePermission(account.getSecUserPermissions());
         //create user detail based on user account.
         final EnMeUserAccountDetails details = SecurityUtils.convertUserAccountToUserDetails(account, true);
         //set the social credentials permission.
         details.setSocialCredentials(socialSignIn);
         SecurityContextHolder.getContext().setAuthentication(
                 new UsernamePasswordAuthenticationToken(details, password, authorities));
         if (log.isInfoEnabled()) {
             log.info("Username "+account.getUsername() + " is logged at "+new Date() + " with social account?"+socialSignIn);
         }
View Full Code Here

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

    /**
     * Get Details.
     */
    public EnMeUserAccountDetails getSecurityDetails(){
        EnMeUserAccountDetails details = null;
        log.trace("Authentication Object:{"+getSecCtx().getAuthentication());
        if (getSecCtx().getAuthentication() != null) {
            if(getSecCtx().getAuthentication().getPrincipal() instanceof EnMeUserAccountDetails){
                details =  (EnMeUserAccountDetails) getSecCtx().getAuthentication().getPrincipal();
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.