Azure java: SAS identifier cannot be found for specified signed identifier -


i'm using sdk java crear sas access blob. code:

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); 

but when try use url access blob error:

<error> <code>authenticationfailed</code> <message> server failed authenticate request. make sure value of authorization header formed correctly including signature. requestid:f1f169d2-0001-003f-115a-3be1d6000000 time:2016-11-10t13:57:14.6192554z </message> <authenticationerrordetail> sas identifier cannot found specified signed identifier </authenticationerrordetail> </error> 

i'm doing same thing in net same blob resulting url (which works) different 1 here:

doesn't work (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 

works (net):

/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 

how fix this?

just looking @ sas token, specifying policy filename. that's not wanted do, , not in .net sas token.

the problem here guess:

blob.generatesharedaccesssignature(policy, externalfilename); 

the second parameter policy name, if api similar .net.

try instead:

blob.generatesharedaccesssignature(policy, null); 

Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -