azure - 通过 Azure 门户获取的 Servicebus SAS token 的时间戳是多少?

标签 azure rest authorization servicebus

我正在尝试使用 Python 中的 REST Api 向我的 Azure Servicebus 队列发送消息(无法在 Orange PI Zero 系统上使用 Azure 包,没有足够的内存来安装包...)。

现在是example page显示特定格式的 Authorization header :

Authorization: SharedAccessSignature sr=your-namespace&sig=Fg8yUyR4MOmXfHfj55f5hY4jGb8x2Yc%2b3%2fULKZYxKZk%3d&se=1404256819&skn=RootManageSharedAccessKey

如何从 Azure 门户获取 SAS token 的 se(“ token 立即到期”:reference)值?它只显示“主要”/“次要”键...

enter image description here

最佳答案

How do I obtain the se ("Token expiry instant": reference) value for my SAS token from the Azure Portal? It only shows "Primary"/"Secondary" key

这是您需要自行计算的内容,因为它指示您的 SAS token 何时到期。例如,如果您希望 SAS token 在创建后 15 分钟内过期,您将获得从现在起 15 分钟后的日期/时间值,并计算该日期/时间与纪元(1 月 1 日, 1970 年 00:00:00 世界标准时间)。

一旦获得该值,您将需要使用此处描述的逻辑来计算签名:https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-sas#generate-a-shared-access-signature-token .

关于azure - 通过 Azure 门户获取的 Servicebus SAS token 的时间戳是多少?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62735329/

相关文章:

node.js - 尝试从 Node 查询 documentDB 时请求 url 无效

Azure Web 作业 - 同一 Web 作业中的多个函数和/或同一 Web 应用程序中的多个 Web 作业对性能有何影响?

java - Exceptionmapper 未在 JAX-RS Jersey 中被调用

android - 从 Restful web 服务获取字节数组文件到 android

java - 使用 Camel 进行 REST 服务调用,需要先调用身份验证 api

security - 如何将 _locale 参数添加到安全路径?

azure - 在 CircleCI 中找不到 postgres_1 的容器

Azure 文档 DB 脏读/写

authorization - Apollo 客户端 + Next.js - 向客户端请求添加授权 token

c# - 如何防止用户手动更改文件?