-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Xero signature failed on verification. #1
Comments
I have the same issue. The signature is out by 1 character compared to the hash result. |
I believe this is the answer: https://community.xero.com/developer/discussion/64820912 Xero on the initial ITR will send some signatures that are correct and some that are incorrect. If you also return a body the ITR will fail. |
@AllenDigital wow, I didn't expect to have an answer here. Thanks! |
Correct. They send an incorrect ITR first and check that you respond with a 401 and no body within 5 seconds. If that happens correctly, they will send a correctly signed header for which you must again respond in 5 seconds with no body and a 200. They are testing to make sure you implemented the ITR correctly before sending correctly signed requests. |
Wow, thanks for the clarification. Never thought of this double check approach, which caused me struggle for few weeks. I think i can proceed with Xero webhook receiver now. Thanks @AllenDigital !!!! |
Hello, my name is Tai.
Based on the sample here I create an receiver for webhooks, using ngrok and dot net core 2.
After encode the payload with webhook key, i got the following generated signature:
BjzNbYUfrzg4g8wxm+dKHaZVrKxr2m75E296fUbD1E4=
But in the request of webhook, i have this signature as:
/jzNbYUfrzg4g8wxm+dKHaZVrKxr2m75E296fUbD1E4=
Here's the full payload body:
`POST /webhooks HTTP/1.1
Host: 3099768b.ngrok.io
Accept: /
Accept-Encoding: gzip,deflate
Content-Type: application/json; charset=utf-8
x-xero-signature: /jzNbYUfrzg4g8wxm+dKHaZVrKxr2m75E296fUbD1E4=
Content-Length: 95
X-Forwarded-Proto: https
X-Forwarded-For: 34.233.225.118
{"events":[],"firstEventSequence": 0,"lastEventSequence": 0, "entropy": "LUWDSUDGSWNZVALZXBEV"}`
Here's the code for generating signature with given webhooks key:
Please help me to check whether i'm doing wrong or something, why the generated signature and the x-xero-signature only different in 1 character ? It works fine for me last week : (. Thanks!
The text was updated successfully, but these errors were encountered: