Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8563545
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T16:59:02+00:00 2026-06-11T16:59:02+00:00

I build web applications using alfresco-community-4.0.e, OpenCMIS, and primefaces as user interface. I need

  • 0

I build web applications using alfresco-community-4.0.e, OpenCMIS, and primefaces as user interface.

I need to create users in alfresco programmatically. I tried to create a user using the following code:

Blockquote 
if (!personService.personExists("tuser1")) {
        personService.createPerson(createDefaultProperties("tuser1", "Test", "User1", "tuser1@localhost", "password"));
        if (logger.isDebugEnabled()) logger.debug("Created tuser1 person");
    }

    if (!personService.personExists("tuser1")) {
        personService.createPerson(createDefaultProperties("tuser1", "Test", "User1", "tuser1@localhost", "password"));
        if (logger.isDebugEnabled()) logger.debug("Created tuser1 person");
    } 

Blockquote

But I am facing problem with the authentication.

I made a class for alfresco authentication that throws the openCMIS and it works fine for creating my custom content and some other custom actions.

Any idea why it is now working with creating user or any other code to build the user programmatically?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T16:59:04+00:00Added an answer on June 11, 2026 at 4:59 pm

    Your code is almost there, but missing one crucial line. As well as creating the person, you also need to create the associated Authentication for them

    You probably want something like

    if (this.authenticationService.authenticationExists(userName) == false)
    {
       this.authenticationService.createAuthentication(userName, password.toCharArray());
    
       PropertyMap ppOne = new PropertyMap(4);
       ppOne.put(ContentModel.PROP_USERNAME, userName);
       ppOne.put(ContentModel.PROP_FIRSTNAME, "firstName");
       ppOne.put(ContentModel.PROP_LASTNAME, "lastName");
       ppOne.put(ContentModel.PROP_EMAIL, userName+"@example.com");
       ppOne.put(ContentModel.PROP_JOBTITLE, "jobTitle");
    
       this.personService.createPerson(ppOne);
    }        
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We're using CruiseControl.Net to do our continuous integration of our web applications. we build
I develop web applications using Django on Mac OSX 10.6. I use Django's built
I am using struts2 to build a web application and I use struts2 tags
I try to build a JSF 2.0 Web application which is using libraries including
I'm trying to build a 4-tier Web-Application in Java. I'm using the Hibernate Framework
We are using IIS7 and dotnet 3.5 in our company to build different web
We use git for most of the web applications we build in our shop,
I have a need to implement a STS-IP server for our web applications and
We are using rpm to deploy our web applications internally. The rpm installs the
I would like to build a server with web services using Java EE, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.