SAS Key - 程序化生成 [英] SAS Key - Programmatic Generation

查看:71
本文介绍了SAS Key - 程序化生成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好! 我们一直在尝试以编程方式为我们的blob存储生成共享访问签名令牌和URL(SAS),遵循构建帐户SAS的文档中的文档。 

阅读文档,特别是有关构建签名字符串的部分, 

Reading the documentation and specifically the section about constructing the signature string, 

- 将URI参数构建为\ n分隔字符串(例如  StringToSign = accountname +" \ n" +
 

- constructing the URI parameters into a \n seperated string (e.g. StringToSign = accountname + "\n" +  

   signedpermissions +" \ n" +
 

    signedpermissions + "\n" +  

   signedservice +" \\ \\ n" +  

    signedservice + "\n" +  

   signedresourcetype +" \ n" +
 

    signedresourcetype + "\n" +  

   signedstart +" \ n" +  

    signedstart + "\n" +  

   signedexpiry +" \ n" +  

    signedexpiry + "\n" +  

    signedIP +" \ n" +  

    signedIP + "\n" +  

    signedProtocol +" \ n" +  

    signedProtocol + "\n" +  

    signedversion +" \ n"  

    signedversion + "\n"  

 

- 将此字符串转换为utf-8字符

- convert this string into utf-8 characters

- 使用我们的存储密钥(商店访问密钥)对此进行编码HMAC SHA256

- use our storage key (store access key) to encode this using HMAC SHA256

- 将其转换为base64

- convert this into base64

我们在这里错过了一步/误解了方向吗? 我们尝试省略并包含"\ n"对于可选参数。  任何帮助将不胜感激,谢谢!

Are we missing a step here / misunderstanding the directions?  We've tried omitting and including the "\n" for optional parameters. Any help would be appreciated, thanks!

推荐答案

只是为了澄清一下,您指的是步骤中的任何Azure文档吗?你收到任何错误吗?
请在隐藏任何私人信息后分享问题的截图?

此部分显示如何以编程方式生成SAS令牌

Just to clarify, are you referring to any Azure doc for the steps? Do you receive any error, if so, kindly do share a screenshot of the issue after concealing any private details? This section shows how to programmatically generate a SAS token

共享访问签名,第2部分:创建和使用带有Blob
存储的SAS

服务SAS:
参见  构建
a服务SAS
 和  服务
SAS示例
 有关构建服务SAS令牌的详细信息。

Service SAS: See Constructing a Service SAS and Service SAS Examples for in-depth information about constructing the service SAS token.

帐户SAS: 参见  构建
帐户SAS
 有关构建帐户SAS令牌的详细信息。

Account SAS: See Constructing an Account SAS for in-depth information about constructing the account SAS token.

请参阅此文章以获取

SAS示例

希望这会有所帮助!

如果上述情况有所帮助或者您需要在此问题上需要进一步的帮助,请告知我们。

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


请点击"标记为答案"帮助您的帖子,这对其他社区成员有益。


这篇关于SAS Key - 程序化生成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆