<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;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Oct 20, 2014, at 8:26 AM, Manoj Kumar S <<a href="mailto:manojkumar.s@samsung.com" class="">manojkumar.s@samsung.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><p style="margin-bottom: 5px; font-size: 12px; font-family: Arial, arial; margin-top: 5px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 16px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">Hi Ryan/ Stefan,<o:p class=""></o:p></p><p style="margin-bottom: 5px; font-size: 12px; font-family: Arial, arial; margin-top: 5px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 16px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""> <o:p class=""></o:p></p><p style="margin-bottom: 5px; font-size: 12px; font-family: Arial, arial; margin-top: 5px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 16px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">I have built a local server, from your code in /example/usage.js of<span class="Apple-converted-space"> </span><a href="https://github.com/hueniverse/hawk" class=""><span class="">https://github.com/hueniverse/hawk</span></a><o:p class=""></o:p></p><p style="margin-bottom: 5px; font-size: 12px; font-family: Arial, arial; margin-top: 5px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 16px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">I debugged through the client and server code on how they calculate and validate the payload hash,<o:p class=""></o:p></p><p style="margin-bottom: 5px; font-size: 12px; font-family: Arial, arial; margin-top: 5px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 16px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">As far as I understood, the error message "Payload is Invalid", happens when server code compares the request hash ( sent as header by  client ) with the generated<o:p class=""></o:p></p><p style="margin-bottom: 5px; font-size: 12px; font-family: Arial, arial; margin-top: 5px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 16px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">hash from payload.</p><div class=""><br class=""></div></div></blockquote><div><br class=""></div></div><div class="">Here are some examples (in Objective-C) to show what unit tests could look like:</div><div class=""><br class=""></div><div class=""><a href="https://github.com/st3fan/bookmarks/blob/master/FirefoxAccountsTests/HawkCredentialsTest.m" class="">https://github.com/st3fan/bookmarks/blob/master/FirefoxAccountsTests/HawkCredentialsTest.m</a></div><div class=""><br class=""></div><div class="">These are unit tests in Java:</div><div class=""><br class=""></div><div class=""><a href="https://github.com/mozilla-services/android-sync/blob/develop/src/test/java/org/mozilla/gecko/sync/net/test/TestHawkAuthHeaderProvider.java" class="">https://github.com/mozilla-services/android-sync/blob/develop/src/test/java/org/mozilla/gecko/sync/net/test/TestHawkAuthHeaderProvider.java</a></div><div class=""><br class=""></div><div class="">Both tests use the example Hawk vectors from <a href="https://github.com/hueniverse/hawk/blob/master/README.md#protocol-example" class="">https://github.com/hueniverse/hawk/blob/master/README.md#protocol-example</a></div><div class=""><br class=""></div><div class=""> S.</div><div class=""><br class=""></div></body></html>