签名规则

兑吧与开发者之间的所有接口交互都需要进行MD5签名、验证,确保传输信息的安全可靠(不可篡改)。

签名原理

MD5签名的原理如下: 将所有的参数值与appSecret按参数名升序进行排列

Md5(value1+value2+...appSecret...+valueN)

appSecret在签名中的顺序取决于他在所有参数名中的顺序。

例:appKey:testappkeyappSecret:testsecret

参数列表:{appKey=testappkey,timestamp=1405495206727}

签名原串:testappkeytestsecret1405495206727

签名url :http://www.xxx.com/xxx?appKey=testappkey&timestamp=129832323&sign=39e73663eb1caf2096968e680991ba2c

签名规则测试用例

为了方便开发者对签名方法进行测试验证,下面提供几个测试用例,开发者可以参考下面的用例,使用相同的输入参数,看产生的签名与我们提供的签名是否一致。

下面的测试用例使用的 appKey="testappkey"appSecret="testappsecret"

用例1:只有一个appKey时的签名

appKey="testappkey" => sign= 925e68506cf5a9ac740aedc2bd78f5e4

用例2:多个参数的签名

appKey="testappkey" timestamp="1415250311646" => sign=868a4339ea0400aec9b7a4742e06120e

用例3:免登录URL中所有参数签名

appKey="testappkey" uid="test111" credits="0" timestamp="1415250311646" => sign=b4dfe715af6ea706417362c0b3f05e81

results matching ""

    No results matching ""