import org.argeo.jcr.ArgeoNames;
import org.argeo.jcr.ArgeoTypes;
import org.argeo.jcr.JcrUtils;
+import org.argeo.security.SecurityUtils;
import org.argeo.security.jcr.JcrSecurityModel;
import org.argeo.security.jcr.JcrUserDetails;
+import org.argeo.security.jcr.SimpleJcrSecurityModel;
import org.springframework.ldap.core.ContextExecutor;
import org.springframework.ldap.core.ContextMapper;
import org.springframework.ldap.core.DirContextAdapter;
private Repository repository;
private JcrProfileListener jcrProfileListener;
- private JcrSecurityModel jcrSecurityModel = new JcrSecurityModel();
+ private JcrSecurityModel jcrSecurityModel = new SimpleJcrSecurityModel();
// Mapping
private Map<String, String> propertyToAttributes = new HashMap<String, String>();
// Node userProfile = SecurityJcrUtils.createUserProfileIfNeeded(
// securitySession, username);
- Node userProfile = jcrSecurityModel.sync(nodeSession, username);
+ Node userProfile = jcrSecurityModel.sync(nodeSession, username,
+ SecurityUtils.authoritiesToStringList(authorities));
// JcrUserDetails.checkAccountStatus(userProfile);
// password
// process
String username = ctx.getStringAttribute(usernameAttribute);
- Node userProfile = jcrSecurityModel.sync(session, username);
+ Node userProfile = jcrSecurityModel.sync(session, username, null);
Map<String, String> modifications = new HashMap<String, String>();
for (String jcrProperty : propertyToAttributes.keySet())
ldapToJcr(userProfile, jcrProperty, ctx, modifications);