- private RepositoryFactory repositoryFactory;
- private Executor systemExecutor;
- private String homeBasePath = "/home";
- private String repositoryAlias = "node";
- private String workspace = null;
-
- public Authentication authenticate(Authentication authentication)
- throws AuthenticationException {
- final OsAuthenticationToken authen = (OsAuthenticationToken) super
- .authenticate(authentication);
- systemExecutor.execute(new Runnable() {
- public void run() {
- try {
- Session session = JcrUtils.getRepositoryByAlias(
- repositoryFactory, repositoryAlias)
- .login(workspace);
- Node userHome = JcrUtils.getUserHome(session,
- authen.getName());
- if (userHome == null)
- JcrUtils.createUserHome(session, homeBasePath,
- authen.getName());
- authen.setDetails(getUserDetails(userHome, authen));
- } catch (RepositoryException e) {
- throw new ArgeoException(
- "Unexpected exception when synchronizing OS and JCR security ",
- e);
- }
- }
- });
- return authen;
- }
+ private Repository repository;
+ private String securityWorkspace = "security";
+ private Session securitySession;