Quickblox API Session Creation With User & Signature Error -
quickblox rest api create session function running without user information not working when added user information.
signature string:success
string signaturestr=string.format("application_id={0}&auth_key={1}&nonce={2}×tamp={3}", this.application_id, this.auth_key, this.nonce, this.timestamp);
signature string:error
string signaturestr=string.format("application_id={0}&auth_key={1}&nonce={2}×tamp={3}&user[login]={4}&user[password]={5}", this.application_id, this.auth_key, this.nonce, this.timestamp,this.user.login,this.user.password);
generate signature function
public string generatehmacsha1(string key, string body) { system.text.encoding encoding = system.text.encoding.utf8; byte[] keybyte = encoding.getbytes(key); hmacsha1 hmacsha1 = new hmacsha1(keybyte); byte[] messagebytes = encoding.getbytes(body); byte[] hashmessage = hmacsha1.computehash(messagebytes); return bytetostring(hashmessage); }
error information
statuscode => 422 unprocessable entity
error message=> unexpected signature
why work?
Comments
Post a Comment