PNS反馈服务返回的"Azure Storage Container URL"如何使用?
How to use the "Azure Storage Container URL" returned by the PNS Feedback service?
我正在尝试获取推送通知的反馈,如下所述:https://docs.microsoft.com/en-us/previous-versions/azure/reference/mt705560(v=azure.100)。
Upon success, an Azure Storage Container URL is returned, complete with authentication token.
我有 URL:
https://pushpnsfb9bf61499e7c8fe.blob.core.windows.net/00000000002002698042?sv=2015-07-08&sr=c&sig=KbF1GtORNzAaCZH9UP7UFi9wMOYBmBgL%2BXLG3Qau9U0%3D&se=2020-08-29T19:10:17Z&sp=rl
但是请求它 returns 身份验证错误:
<Error>
<Code>AuthenticationFailed</Code>
<Message>Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature...</Message>
<AuthenticationErrorDetail>Signature did not match. String to sign used was... </AuthenticationErrorDetail>
</Error>
我正在尝试按照 https://docs.microsoft.com/en-us/azure/storage/blobs/storage-blob-service-sas-create-dotnet?tabs=dotnet#create-a-service-sas-for-a-blob-container 上的文档进行操作。 URL 有 sr=c
,这似乎意味着我需要一个“用于 blob 容器的 SAS”。
但是我从哪里获得令牌?返回的 URL 有一个 sig
查询字符串参数 - 我尝试使用它来签署请求,但没有成功。
我做错了什么?
当我们调用获取平台通知服务 (PNS) 反馈 rest api 时,我们将获得一个带有 sas 令牌的容器 url。并且 sas 令牌在容器级别具有读取和列出权限。因此我们可以使用 azure blob rest api 来读取容器中任何 blob 的内容、属性、元数据或阻止列表,或者使用令牌列出容器中的 blob。详情请参考here
例如
获取容器url
测试
一种。列出 blob
GET https://pushpnsfb2f34ecd6733e74.blob.core.windows.net/00000000002000276266?
<sas token e.t. sv=2015-07-08&sr=c&sig=SQodHcRM6p04ag9rJZBqPDmr1NMd%2FbIWoPzMZrB9TpI%3D&se=2020-09-02T05%3A28%3A07Z&sp=rl>
&restype=container&comp=list
b。读取 blob 内容
GET GET https://pushpnsfb2f34ecd6733e74.blob.core.windows.net/00000000002000276266/<blob name>?
<sas token e.t. sv=2015-07-08&sr=c&sig=SQodHcRM6p04ag9rJZBqPDmr1NMd%2FbIWoPzMZrB9TpI%3D&se=2020-09-02T05%3A28%3A07Z&sp=rl>
有关 Azure Blob rest api 的更多详细信息,请参阅 here。
我正在尝试获取推送通知的反馈,如下所述:https://docs.microsoft.com/en-us/previous-versions/azure/reference/mt705560(v=azure.100)。
Upon success, an Azure Storage Container URL is returned, complete with authentication token.
我有 URL:
https://pushpnsfb9bf61499e7c8fe.blob.core.windows.net/00000000002002698042?sv=2015-07-08&sr=c&sig=KbF1GtORNzAaCZH9UP7UFi9wMOYBmBgL%2BXLG3Qau9U0%3D&se=2020-08-29T19:10:17Z&sp=rl
但是请求它 returns 身份验证错误:
<Error>
<Code>AuthenticationFailed</Code>
<Message>Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature...</Message>
<AuthenticationErrorDetail>Signature did not match. String to sign used was... </AuthenticationErrorDetail>
</Error>
我正在尝试按照 https://docs.microsoft.com/en-us/azure/storage/blobs/storage-blob-service-sas-create-dotnet?tabs=dotnet#create-a-service-sas-for-a-blob-container 上的文档进行操作。 URL 有 sr=c
,这似乎意味着我需要一个“用于 blob 容器的 SAS”。
但是我从哪里获得令牌?返回的 URL 有一个 sig
查询字符串参数 - 我尝试使用它来签署请求,但没有成功。
我做错了什么?
当我们调用获取平台通知服务 (PNS) 反馈 rest api 时,我们将获得一个带有 sas 令牌的容器 url。并且 sas 令牌在容器级别具有读取和列出权限。因此我们可以使用 azure blob rest api 来读取容器中任何 blob 的内容、属性、元数据或阻止列表,或者使用令牌列出容器中的 blob。详情请参考here
例如
获取容器url
测试 一种。列出 blob
GET https://pushpnsfb2f34ecd6733e74.blob.core.windows.net/00000000002000276266?
<sas token e.t. sv=2015-07-08&sr=c&sig=SQodHcRM6p04ag9rJZBqPDmr1NMd%2FbIWoPzMZrB9TpI%3D&se=2020-09-02T05%3A28%3A07Z&sp=rl>
&restype=container&comp=list
b。读取 blob 内容
GET GET https://pushpnsfb2f34ecd6733e74.blob.core.windows.net/00000000002000276266/<blob name>?
<sas token e.t. sv=2015-07-08&sr=c&sig=SQodHcRM6p04ag9rJZBqPDmr1NMd%2FbIWoPzMZrB9TpI%3D&se=2020-09-02T05%3A28%3A07Z&sp=rl>
有关 Azure Blob rest api 的更多详细信息,请参阅 here。