Title: Samsung Enterprise Portal mySingle

Hi,

 

I am working to bring up the firefox sync for Samsung's platform Tizen in C++.

 

When I'm making a post request to

/v1/certificate/sign

 

I am getting, the following error

 

{"code":401,"errno":109,"error":"Unauthorized","message":"Payload is invalid","info":"https://github.com/mozilla/fxa-auth-server/blob/master/docs/api.md#response-format"}

 

On searching online and response format in the link, I am not able to find the cause and solution for "Payload is invalid" error message.

 

I took the following api link and the android opensource firefox sync code for reference, 

https://github.com/mozilla/fxa-auth-server/blob/master/docs/api.md#post-v1certificatesign

 

My request body,

{

"publicKey":

{

"n":"118914442118587944337617760429415407384602982191049892815435313230898349895616980949965999312628028361498058274682246958387547150499585317279344413575574419269396469365814674292819599379624480603567156410797782487484670866208603048059842711401777345031666284642047683915624456602199119212316405809050063684547",

"e":"65537",

"algorithm":"RS"

},

"duration":43200000

}

 

 

 

My headers,

Host: api.accounts.firefox.com:443

 

Authorization:

Hawk id="511244db3170b2b00306b11261cd25cf95043e242ab3fe758a7ba292bb74d757",

ts="1413443649",

nonce="fZRj1dI+UJA=",

hash="47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=",

mac="33+lswVsme8sjEvSnrsf7DThiz+pwZEoVRQ6YjPcxZU="

 

Content-Type: application/json

 

charsets: utf-8

 

 

 

 

This is how I create my hash before converting it to encodeBase64String format,

 

MessageDigest* digest = MessageDigest::getInstance("SHA-256");

                digest->update(toBytes(hawk.1.payload\n));

                digest->update(toBytes("application/json"));

                digest->update(toBytes("\n"));

 

                InputStream *stream = new ByteArrayInputStream(getBytes(entity)); à getbytes of Body

                int numRead;

                bytearray buffer(4096);

                while (-1 != (numRead = stream->read(buffer))) {

                                if (numRead > 0) {

                                                digest->update(buffer);

                                }

                }

                digest->update(toBytes("\n"));

                stream->close();

                return digest->digest(); à this value is passed as hash to encodeBase64

 

 

 

I am completely blocked at this point as I am unaware of how to solve this issue,

Could please provide help and guidance on how to solve this.

 

Thanks in advance,

 

Regards,

Manoj

 

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

Reply via email to