Undocumented change to the Customer Object?

lock
push_pin
done
Answered
5

Hello, 

We have created external customer centers for some of our customers, and have created custom CRMscripts to handle the authentication (pass inn username and password) so that we can use the customers that is registered inside SuperOffice. 

We have leveraged the method that has been a part of the lib-auth on github to handle this: 
CRMScripts/lib-auth.crm at master · SuperOffice/CRMScripts · GitHub 

Today, or more likely after this weekends update of online, this is now broken, and after some quick tests its not longer possible to getValue("password") on the customer-object. This means nobody can log in to the customer center anymore. 

We cant see any reason why this is now changed, and I'm unsure if its a BUG or an intended fix of something that should not have been an option (?)

Has anyone else experienced the same, and have anyone been able to find a workaround? 

The only option, as I see it, would be to use the new method on the PersonAgent, POST Agents/Person/GetUserCandidateByPerson | SuperOffice Docs , but that requires the personId, so it would mean we have to first lookup the person by username, then pass the personId to this new method to get the password. 

It is also a question about how this would look when used through a CRMScript.
I expected something like this to work: 
 
If i pass in the id of a person here it looks OK, but i unfortunately dont know what methods are available on NSUserCandidate as there is no intellisense for it.. 

//Eivind





15 May 2023 | 08:24 AM

All Replies (5)

I've no knowledge of any crippling changes with the Customer CRMScript type, or associated methods and properties. 

The CRMScript intellisense is generated from the CRMScript reference section on docs, and unfortunately those haven't been updated - temporary unavailable resource.

So, the only place to get the documentation for those types at the moment are the SOAP or REST endpoints. You of course must have CRMScript knowledge to be able to know you have to prefix the properties with get and set to work with the returned data type.

 

 

15 May 2023 | 08:56 AM

Hi Tony,

I understand that intellisense might not be up to date. 

We still need to figure out why this code fails after the latest update:

//Create a hash of the given password. Hashing method is done by SuperOfice.
String hashPassword(String password) {
  //Setting the password property, and retrieving value again will return the hashed value.
  Customer c;
  c.setValue("password", password); 
  return c.getValue("password");
}

It has been working up untill this weekend, and we have verified it works on a local onsite installation (e.g. earlier version) and does not work in online or SOD atm. 

Is this a bug that will be fixed or is it how it will continue to be in the future? Naturally we need to land on what we do for our customers, as their CC is basicaly not working atm. 

//Eivind

15 May 2023 | 09:08 AM

Based on the documentation there does not seem to be a way to actually set the person/customer password, only to generate a new credential if the user does not have one yet.

#setLanguageLevel 4;

NSPersonAgent personAgent;


Integer personId = 1234;
String userName = "dumm@company.local";
Bool accessAllRequests = false;
  
/// create or update
NSUserCandidate updatedUser = personAgent.CreateOrUpdateUserCandidate(personId, userName, accessAllRequests);

// or retrieve existing
//NSUserCandidate updatedUser = personAgent.GetUserCandidateByPerson(personId);

printLine(updatedUser.GetUserCandidateId().toString());
printLine(updatedUser.GetSecretKey());
printLine(updatedUser.GetSecretValue());
15 May 2023 | 10:00 AM

Hi all,

We are aware of this problem. It is caused by a change to the underlying password mechanisms and the Customer class' getValue("password") method. We are currently working on it to create a solution ASAP. Information will follow.

Sverre

15 May 2023 | 12:20 PM

Made a new post for this to make sure I got everyone's attention :-)

Breaking Change Related To Customer Portal Authentication

15 May 2023 | 02:55 PM

Add reply