Java Azure Request Signing

后端 未结 2 1011
借酒劲吻你
借酒劲吻你 2021-02-06 19:38

I am using the latest Azure SDK Storage emulator. I am trying to sign a request to my blob. When I run the below code I am getting auth error.

I can\'t figure out what i

2条回答
  •  太阳男子
    2021-02-06 20:05

    Based on the documentation here: http://msdn.microsoft.com/en-us/library/windowsazure/dd179428, I believe there's an issue with the way you're constructing "Canonicalized Resource String" part of your signature.

    A few things I noticed:

    • You're appending query string parameter (comp=list) to this string which you should not.
    • If you're constructing this string against development storage (which you're doing), "devstoreaccount1" should come twice.

    For example, if I am trying to list just 1 blob container in my development storage account, this should be the canonocalized resource string based on the following request URL - 127.0.0.1:10000/devstoreaccount1/?restype=container&comp=list&$maxresults=1:

    /devstoreaccount1/devstoreaccount1/

    $maxresults:1

    comp:list

    restype:container

提交回复
热议问题