This is tough to debug with just seeing the Hawk header.

I’ve been through this myself recently when I worked on 
https://github.com/st3fan/moz-storageserver, which has a (server-side) Hawk 
implementation too.

For me the most useful thing was to have good unit tests. The Hawk spec at 
https://github.com/hueniverse/hawk shows some example encoded requests and you 
can use those requests and resulting content hashes and request MACs in your 
test.

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.

Make sure the content-type in the Hawk content hash matches the content type of 
your actual request.

 S.

On Sep 24, 2014, at 5:13 AM, Partha Debnath <[email protected]> wrote:

> Hello All,
> I am trying to implement FireFox Sync Adapter in C++.I have implemented down 
> sync of data from FireFox
> server and it is working fine.But, while I was trying to upload data into 
> FIreFox server, I got an error saying
> "401 Unauthorized".I have developed all the above mentioned fuctionality by 
> understanding Mozilla Sync
> Adapter for android.
> Following are the details of the upsync request :
> 1. Header : Authorization:Hawk 
> id="eyJhbGciOiJSUzI1NiJ9.eyJmeGEtZ2VuZXJhdGlvbiI6MTM5NTY1ODc4NDk0NCwiZnhhLWxhc3RBdXRoQXQiOjE0MTE1MzY5ODUsImZ4YS12ZXJpZmllZEVtYWlsIjoic3JpYmttdGVzdDFAcmVkaWZmbWFpbC5jb20iLCJwdWJsaWMta2V5Ijp7ImFsZ29yaXRobSI6IlJTIiwibiI6IjEzNTIyODc1NTA4NjM3NDk2MDY3MjUzMjE4OTI0MjcyNjg2NDQ0MDQ4NjI1ODI1NzE0NTE3NTA2NDkzMTkxNDM4MDA3ODI1Nzk1MzAzNjE5NTQ2ODQ0MDMxOTQwNjcxMjE2MDUyMjIwOTAxNDczMzI4OTA3MzQzMTg1ODk2NTAzMzQ4MTMwOTU4NjMwMDUwNzU5OTI4NDUyODY4MDUwNTUwOTg3Nzk4ODQ4OTQyOTg0MDYxNTE1ODkzODk0NzYxNjQ0MDY5MDIxNDY3MzkyMzk0Mzc5NzQ5NTk0ODExOTMwMjU5MjU1NTg5Mzk1ODI2MzE5OTg4NTUyNDUyNzA3MTE0MDc5MDg5NTg1NzcxNjcwMzA1NjI0MjAxNjg3MDI5NDUxMjEzNTMyMzE
> ...

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

_______________________________________________
Dev-fxacct mailing list
[email protected]
https://mail.mozilla.org/listinfo/dev-fxacct

Reply via email to