开发者社区> 问答> 正文

oss SignatureDoesNotMatch 问题,百度了很多,没解决啊


{
    "header": {
        "server": "AliyunOSS",
        "date": "Tue, 24 Nov 2015 05:57:11 GMT",
        "content-type": "application/xml",
        "content-length": "836",
        "connection": "keep-alive",
        "x-oss-request-id": "5653FC37236AAAD53EDF1F29",
        "_info": {
            "url": "http://loganv.oss-cn-qingdao.aliyuncs.com/",
            "content_type": "application/xml",
            "http_code": 403,
            "header_size": 202,
            "request_size": 396,
            "filetime": -1,
            "ssl_verify_result": 0,
            "redirect_count": 0,
            "total_time": 0.096169,
            "namelookup_time": 0.001422,
            "connect_time": 0.053217,
            "pretransfer_time": 0.053356,
            "size_upload": 0,
            "size_download": 836,
            "speed_download": 8693,
            "speed_upload": 0,
            "download_content_length": 836,
            "upload_content_length": 0,
            "starttransfer_time": 0.096138,
            "redirect_time": 0,
            "redirect_url": "",
            "primary_ip": "115.28.250.5",
            "certinfo": [],
            "primary_port": 80,
            "local_ip": "172.16.0.199",
            "local_port": 61716,
            "method": "GET"
        },
        "oss-request-url": "http://loganv.oss-cn-qingdao.aliyuncs.com",
        "oss-redirects": 0,
        "oss-stringtosign": "GET\n\napplication/x-www-form-urlencoded\nTue, 24 Nov 2015 05:57:11 GMT\n/",
        "oss-requestheaders": {
            "Content-Type": "application/x-www-form-urlencoded",
            "Date": "Tue, 24 Nov 2015 05:57:11 GMT",
            "Host": "loganv.oss-cn-qingdao.aliyuncs.com",
            "Authorization": "OSS O9gqQuhJQmfa8nwA:rkdbzlffy4ZZ7rKdjlc17gYGwqY="
        }
    },
    "body": "\n\n SignatureDoesNotMatch</Code>\n The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message>\n 5653FC37236AAAD53EDF1F29</RequestId>\n loganv.oss-cn-qingdao.aliyuncs.com</HostId>\n O9gqQuhJQmfa8nwA</OSSAccessKeyId>\n rkdbzlffy4ZZ7rKdjlc17gYGwqY=</SignatureProvided>\n GET\n\napplication/x-www-form-urlencoded\nTue, 24 Nov 2015 05:57:11 GMT\n/loganv/</StringToSign>\n 47 45 54 0A 0A 61 70 70 6C 69 63 61 74 69 6F 6E 2F 78 2D 77 77 77 2D 66 6F 72 6D 2D 75 72 6C 65 6E 63 6F 64 65 64 0A 54 75 65 2C 20 32 34 20 4E 6F 76 20 32 30 31 35 20 30 35 3A 35 37 3A 31 31 20 47 4D 54 0A 2F 6C 6F 67 61 6E 76 2F </StringToSignBytes>\n</Error>\n",
    "status": 403
}




上面是错误的返回结果,
access_id跟access_key
我在我的阿里云,[ [font='Helvetica Neue', 'Luxi Sans', 'DejaVu Sans', Tahoma, 'Hiragino Sans GB', STHeiti, 'Microsoft YaHei']Access Key管理 [font='Helvetica Neue', 'Luxi Sans', 'DejaVu Sans', Tahoma, 'Hiragino Sans GB', STHeiti, 'Microsoft YaHei'] ]里面复制,核对了很多次了;


求解!
thanks!

展开
收起
loganv 2015-11-24 14:04:25 35510 0
6 条回答
写回答
取消 提交回答
  • Reoss SignatureDoesNotMatch 问题,百度了很多,没解决啊
    少了下面这行 真是坑爹 我还是在开发者文档中找到的
    //使用post提交
    request.setMethod(MethodType.POST);
    2017-07-28 11:38:30
    赞同 1 展开评论 打赏
  • 回 6楼我在上天了的帖子
    谢谢啦!
    2017-07-15 18:35:44
    赞同 展开评论 打赏
  • Reoss SignatureDoesNotMatch 问题,百度了很多,没解决啊
    OSS\Core\OssException
    SignatureDoesNotMatch: The request signature we calculated does not match the signature you provided. Check your key and signing method. RequestId: 5791E9534F29D0B715C06A43

    请吧OSS bucket的外网链接:

    endpoint = 'xxxxxx.oss-cn-beijing.aliyuncs.com';
    修改为 endpoint = 'oss-cn-beijing.aliyuncs.com';

    不用谢我,我是雷锋
    2016-07-25 09:49:33
    赞同 2 展开评论 打赏
  • Reoss SignatureDoesNotMatch 问题,百度了很多,没解决啊
    请问楼主解决问题了吗?
    我也遇到同样的问题
    2016-05-02 14:21:20
    赞同 展开评论 打赏
  • 看起来签名字符串的时候是不对的
    发送端签名的字符串是:GET\n\napplication/x-www-form-urlencoded\nTue, 24 Nov 2015 05:57:11 GMT\n/",

    OSS Server端签名的是:GET\n\napplication/x-www-form-urlencoded\nTue, 24 Nov 2015 05:57:11 GMT\n/loganv/

    -------------------------

    你把初始化的部分贴出来看下?
    注意别把AccessKeySecret贴出来

    -------------------------

    回 4楼(栗子雪忆) 的帖子
    如果是自主开发的,可以参考各个语言的SDK实现方式。
    另外也可以使用wireshark等网络抓包工具,对比API文档,查看签名的字符串
    https://yq.aliyun.com/articles/34846?spm=0.0.0.0.RzierZ
    2015-11-24 14:51:01
    赞同 展开评论 打赏
  • "Authorization": "OSS O9gqQuhJQmfa8nwA: rkdbzlffy4ZZ7rKdjlc17gYGwqY="
    这个你是怎么算出来的?
    2015-11-24 14:13:30
    赞同 展开评论 打赏
滑动查看更多
问答排行榜
最热
最新

相关电子书

更多
OSS运维进阶实战手册 立即下载
《OSS运维基础实战手册》 立即下载
OSS运维基础实战手册 立即下载