.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();
//set new authentication.
SecurityContextHolder.getContext().setAuthentication(token);
if (log.isInfoEnabled()) {