0
我正在使用SDK for java編寫SAS來訪問blob。 這是代碼:Azure java:找不到指定的簽名標識符的SAS標識符
SharedAccessBlobPolicy policy = new SharedAccessBlobPolicy();
policy.setPermissionsFromString("r");
Calendar date = Calendar.getInstance();
Date expire = new Date(date.getTimeInMillis() + (expirationMinutes * 60000));
Date start = new Date(date.getTimeInMillis());
policy.setSharedAccessExpiryTime(expire);
policy.setSharedAccessStartTime(start);
return blob.getUri().toString()+"?"+blob.generateSharedAccessSignature(policy, externalFileName);
但是當我嘗試使用URL訪問BLOB我得到這個錯誤:
<Error>
<Code>AuthenticationFailed</Code>
<Message>
Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature. RequestId:f1f169d2-0001-003f-115a-3be1d6000000 Time:2016-11-10T13:57:14.6192554Z
</Message>
<AuthenticationErrorDetail>
SAS identifier cannot be found for specified signed identifier
</AuthenticationErrorDetail>
</Error>
我在做同樣的事情在NET爲同一BLOB一個生成的URL(工作)不同的是,一個我來到這裏:
無效(JAVA):
/mycontainer/privadoPrueba/cat1.jpg?sig=FFLVk%2FPViHBZhH1JIW6wBbWiJ0%2Bgz0U8wjFzgRoytNo%3D&st=2016-11-10T13%3A55%3A06Z&se=2016-11-10T14%3A06%3A06Z&sv=2015-07-08&si=privadoPrueba%2Fcat1.jpg&sp=r&sr=b
作品(網絡):
/mycontainer/privadoPrueba/cat1.jpg?sv=2015-07-08&sr=b&sig=WyiJWltZFj1AkkzST6mo2NjBF1tRSXxrkMP5LEAGJNk%3D&st=2016-11-10T14%3A05%3A41Z&se=2016-11-10T14%3A16%3A41Z&sp=r
我該如何解決這個問題?
你上面提到的兩個SAS網址,你可以分辨出哪一個作品? –
第二個問題,我將其添加到問題 – moondaisy