<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">This is tough to debug with just seeing the Hawk header.<div><br></div><div>I’ve been through this myself recently when I worked on <a href="https://github.com/st3fan/moz-storageserver">https://github.com/st3fan/moz-storageserver</a>, which has a (server-side) Hawk implementation too.</div><div><br></div><div>For me the most useful thing was to have good unit tests. The Hawk spec at <a href="https://github.com/hueniverse/hawk">https://github.com/hueniverse/hawk</a> shows some example encoded requests and you can use those requests and resulting content hashes and request MACs in your test.</div><div><br></div><div>Make sure to test both GET and POST or PUT requests. With a GET the content hash is missing while it is included with requests that have a body.</div><div><br></div><div>Make sure the content-type in the Hawk content hash matches the content type of your actual request.</div><div><br></div><div><div> S.</div><div><br><div><div>On Sep 24, 2014, at 5:13 AM, Partha Debnath <<a href="mailto:partha.dn@samsung.com">partha.dn@samsung.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="line-height: 1.4; margin: 10px; font-family: Arial, arial; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><p style="margin-top: 5px; font-family: Arial, arial; margin-bottom: 5px; font-size: 9pt;">Hello All,</p><p style="margin-top: 5px; font-family: Arial, arial; margin-bottom: 5px; font-size: 9pt;">I am trying to implement FireFox Sync Adapter in C++.I have implemented down sync of data from FireFox</p><p style="margin-top: 5px; font-family: Arial, arial; margin-bottom: 5px; font-size: 9pt;">server and it is working fine.But, while I was trying to upload data into FIreFox server, I got an error saying</p><p style="margin-top: 5px; font-family: Arial, arial; margin-bottom: 5px; font-size: 9pt;">"<strong><span style="background-color: rgb(255, 0, 0);">401 Unauthorized</span></strong>".I have developed all the above mentioned fuctionality by understanding Mozilla Sync</p><p style="margin-top: 5px; font-family: Arial, arial; margin-bottom: 5px; font-size: 9pt;">Adapter for android.</p><p style="margin-top: 5px; font-family: Arial, arial; margin-bottom: 5px; font-size: 9pt;">Following are the details of the upsync request :</p><p style="margin-top: 5px; font-family: Arial, arial; margin-bottom: 5px; font-size: 9pt;"><u><strong>1. Header :</strong></u><span class="Apple-converted-space"> </span>Authorization:Hawk id="eyJhbGciOiJSUzI1NiJ9.eyJmeGEtZ2VuZXJhdGlvbiI6MTM5NTY1ODc4NDk0NCwiZnhhLWxhc3RBdXRoQXQiOjE0MTE1MzY5ODUsImZ4YS12ZXJpZmllZEVtYWlsIjoic3JpYmttdGVzdDFAcmVkaWZmbWFpbC5jb20iLCJwdWJsaWMta2V5Ijp7ImFsZ29yaXRobSI6IlJTIiwibiI6IjEzNTIyODc1NTA4NjM3NDk2MDY3MjUzMjE4OTI0MjcyNjg2NDQ0MDQ4NjI1ODI1NzE0NTE3NTA2NDkzMTkxNDM4MDA3ODI1Nzk1MzAzNjE5NTQ2ODQ0MDMxOTQwNjcxMjE2MDUyMjIwOTAxNDczMzI4OTA3MzQzMTg1ODk2NTAzMzQ4MTMwOTU4NjMwMDUwNzU5OTI4NDUyODY4MDUwNTUwOTg3Nzk4ODQ4OTQyOTg0MDYxNTE1ODkzODk0NzYxNjQ0MDY5MDIxNDY3MzkyMzk0Mzc5NzQ5NTk0ODExOTMwMjU5MjU1NTg5Mzk1ODI2MzE5OTg4NTUyNDUyNzA3MTE0MDc5MDg5NTg1NzcxNjcwMzA1NjI0MjAxNjg3MDI5NDUxMjEzNTMyMzE</p><div>...</div></div></blockquote></div></div></div></body></html>