function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
AdamJonesAdamJones 

Apex-for-Xero integration failing with signature_invalid - Failed to validate signature

We have an integration between SalesForce and Xero that uses the apex for Xero libraries available here: https://github.com/benedwards44/Apex-for-Xero

This was working perfectly but for some unknown reason communication can't be made between the two systems with the error logs showing "signature_invalid - Failed to validate signature"

Xero can't help me much as there isn't any info on their end of whats going on due to how early the failure is in connecting to their api.

Anyone have experience of this that can assist ?

Best Answer chosen by AdamJones
AdamJonesAdamJones
I've resolved this; it was the consumer key being wrong on the SalesForce side.
 

All Answers

Khan AnasKhan Anas (Salesforce Developers) 
Hi Adam,

Greetings to you!

Make sure you are using the correct Public key. Install correct public key as mentioned in the link. According to Xero documentation (https://developer.xero.com/documentation/auth-and-limits/oauth-issues), some possible causes of this error are:
  1. The public-private application certificate key pair used to sign requests does not match the public key uploaded to your application in the Xero Developer Centre (http://api.xero.com/)
  2. The application consumer key does not match the application certificate keypair
  3. Not all expected elements are being used to generate the signature.
I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thanks and Regards,
Khan Anas
AdamJonesAdamJones
Hi Khan, tried all these I'm afraid.  None of them ring true.
AdamJonesAdamJones
I've resolved this; it was the consumer key being wrong on the SalesForce side.
 
This was selected as the best answer