Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Content Management (Extended ECM)
API, SDK, REST and Web Services
CreateUser / Password
Alexis_Degaine
I create a user with the CreateUser LAPI method.But, I can't log in as the new user with the password I pass as a parameter to the function. Actually, I have to change the password using Livelink interface to be able to log in with the new user.Any idea ?Thanks in advance.
Find more posts tagged with
Comments
Appu_Nair
A couple of thingsWhat livelink version and what lapi version.Do you have DirSvcs in livelink using SSO and is thepasswords being set to "hidden".All I am trying to see is whether in your livelink people see the "login" screen or are they integrated wih some authentication mechanism.In your code you are allowing at least "Login" and "PA" to the user right ?
Carsten_Kulms
Message from Carsten Kulms via eLinkDid you set all the required privileges on creation? E.g. the minimum for login isPRIV_LOGIN | PRIV_UAPI_SESSION | PRIV_DAPI_SESSION | PRIV_WAPI_SESSIONSee the description of the User Privilege Constants in the LAPIreference.
Alexis_Degaine
Livelink version is 9.5.0I don't know what LAPI version I have. I program web services with Java and I test them with SOAP UI, so I can see that the user is successfully added to Livelink.Livelink people see the "login" screen. There is no authentication mechanism.On creation, I set all the privileges so I think that I should be able to log in.Thanks for your help.
Appu_Nair
here's a link to a bulkuser addition file at the self registering communities site
http://communities.opentext.com/communities/llisapi.dll?func=doc.Fetch&nodeid=6288788As
Craten points out in my code I am setting the privs correctly like this and this has worked for meSee if your code kind of looks like it or post your code and hopefully somebody might spot some thing
Alexis_Degaine
Here is my code to create a user.Actually, I read the user information in a file.Hope it could be useful.String UserLogin = null; String UserPassword = null; LLValue UserID = null; String UserFirstName = null; String UserLastName = null; String UserTitle = null; String UserDepartment = null; int UserPrivileges = 0; LLValue UserData = null; boolean create=false; Logger logger = null; try { // Create a file handler FileHandler handler = new FileHandler("C:\\createUsersLog.log"); handler.setFormatter(new SimpleFormatter()); // Add file handler to the logger logger = Logger.getLogger("createUsers"); logger.addHandler(handler); } catch (IOException e) { e.printStackTrace(); } //Reading the user Information from a file try { File file = new File(input.getUserFile()); BufferedReader dataIn = new BufferedReader(new FileReader(file)); String line = null; while ((line = dataIn.readLine()) != null) { String[] value = line.split(";"); UserLogin = value[0].toString(); UserPassword = value[1].toString(); UserID = new LLValue(value[2].toString()); UserFirstName = value[3].toString(); UserLastName = value[4].toString(); UserTitle = value[5].toString(); UserDepartment = value[6].toString(); UserData = new LLValue(value[7].toString()); UserPrivileges = Integer.parseInt(value[8].toString()); logger.info("login: "+UserLogin); logger.info("password: *"+UserPassword+"*"); logger.info("ID: "+UserID); logger.info("FN: "+UserFirstName); logger.info("LN: "+UserLastName); logger.info("title: "+UserTitle); logger.info("department: "+UserDepartment); logger.info("data: "+UserData); logger.info("privileges: "+UserPrivileges); } dataIn.close(); } catch (IOException ex) { Logger.getLogger(accountAccessWS.class.getName()).log(Level.SEVERE, null, ex); } //Connecting to the server try { //Initialisation of the admin session LLSession session = new LLSession(input.getServerPMED(), 2099, null, input.getAdminLogin(), input.getAdminPwd()); LAPI_USERS LLUser = new LAPI_USERS(session); int status; //User attributes LLValue attributes = (new LLValue()).setAssocNotSet(); attributes.add("FirstName",UserFirstName); attributes.add("LastName",UserLastName); attributes.add("Title",UserTitle); //Create a group if it doesn't exist //Group parameters String groupName=UserDepartment; int leaderID=0; String domainName=""; LLValue groupID = (new LLValue()); int groupStatus; groupStatus = LLUser.CreateGroupEx(LAPI_USERS.GROUP, groupName,leaderID, UserData, domainName, groupID); //Error handling if (groupStatus != 0) { String statustext = session.getStatusMessage(); String errtext = session.getErrMsg(); String apitext = session.getApiError(); logger.info("groupStatus: "+groupStatus); logger.warning("statustext : " + statustext); logger.warning("errtext : " + errtext); logger.warning("apitext : " + apitext); logger.warning("\nERROR: " + statustext + "\n" + errtext + "\n" + apitext); } else { logger.info("\nSUCCESS: New Group " + groupName + " has been created"); } //Code to add the new user //We have to determine first if the user that we are creating already exists status = LLUser.CreateUser(UserLogin, UserPassword, UserPrivileges, UserData, LAPI_USERS.GROUP , UserDepartment, attributes, UserID); //Error handling if (status != 0) { String statustext = session.getStatusMessage(); String errtext = session.getErrMsg(); String apitext = session.getApiError(); logger.warning("statustext : " + statustext); logger.warning("errtext : " + errtext); logger.warning("apitext : " + apitext); logger.warning("\nERROR: " + statustext + "\n" + errtext + "\n" + apitext); } else { logger.info("\nSUCCESS: New user " + UserLogin + " has been added"); create=true; } } catch (Throwable e) { String x = e.getClass().getName(); String s = e.getMessage(); logger.warning(s); } output.value = new com.parexel.webservices.b.pmed.accountaccessws.CreateUserResponse(); output.value.setStatusCreateUser(create);
Carsten_Kulms
Message from Carsten Kulms via eLinkI see, you're using Live Services ... unfortunately I'm not familiarwith them.If I understand correctly the documentation it is the function"createUser" of the "Users" service. This function takes a parameter"permInfo" of type "UserPermInfo".Now I don't see how you can set on an UserPermInfo instance any of thedocumented user permissions: The UserPermInfo class provides only aparameter less constructor and no single setter or getter.Seems as if this is the cause of the observed behaviour: The createduser has no permissions at all. You should be able to verify that by theuser administration UI. (I cannot verify on my own due to lack of acorresponding setup.)
Carsten_Kulms
Message from Carsten Kulms via eLinkAddition: A possible workaround could(! cannot check on my own) be tofirst obtain the UGDInfo for an existing user with the required"userPrivileges" and then use that UserPermInfo object with thecreateUser call.As already said: don't know if this works.