URL 编码 - oauth_signature

发布于 2025-01-06 08:25:39 字数 716 浏览 2 评论 0原文

我已成功设置 oauth 身份验证以使用 Sharpbox 访问我的保管箱。 Sharpbox 是一个开源“前端”,负责处理流程的具体细节。使用它我可以返回我帐户中特定文件夹中的文件信息。

我将文件名和生成的 URI 绑定到 VS 2010 Web 应用程序中的 gridview。我有一个超链接,其中文本设置为名称,DataNavigateUrlFields 设置为唯一 URL。如果 url 字符串的 oauth_signature 部分中没有“+”字符,则效果很好。如果有加号,则返回 "{"error": "无效签名。预期签名基字符串:“

感谢您的考虑。


感谢您的帮助,这是我的代码

Public Sub MakeURL()
    dbOpen()
    Dim myfolder As ICloudDirectoryEntry = dropBoxStorage.GetFolder("/DIR/SUBDIR/")
    Filename = Filename & "_POID_" & poid & ".pdf"
    pdfurl = dropBoxStorage.GetFileSystemObjectUrl(Filename, myfolder).ToString
    dbClose()
    pdfurl = pdfurl.Replace("+", "%2B")
    Response.Redirect(pdfurl)
     End Sub

I have successfully setup the oauth authentication to access my dropbox using sharpbox. Sharpbox is an open source "front end" that handles the nuts and bolts of the process. Using it i can return file info in a particular folder in my account.

I bind the filename and a generated URI to a gridview in a VS 2010 web app. I have a hyperlink with the text set to name and the DataNavigateUrlFields to the unique URL. It works great IF there is no "+" character in the oauth_signature part of the url string. If the plus is there, it returns "{"error": "Invalid signature. Expected signature base string:"

Thanks for your consideration.


Thank you for your help, here is my code

Public Sub MakeURL()
    dbOpen()
    Dim myfolder As ICloudDirectoryEntry = dropBoxStorage.GetFolder("/DIR/SUBDIR/")
    Filename = Filename & "_POID_" & poid & ".pdf"
    pdfurl = dropBoxStorage.GetFileSystemObjectUrl(Filename, myfolder).ToString
    dbClose()
    pdfurl = pdfurl.Replace("+", "%2B")
    Response.Redirect(pdfurl)
     End Sub

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

绻影浮沉 2025-01-13 08:25:39

OAuth 1 签名使用百分比编码(请参阅 RFC 5849)。规范明确规定空格 不应编码为 +,而应使用 %20 编码。将 + 替换为 %20

OAuth 1 Signature uses Percent Encoding (See RFC 5849). The specification clearly states that a space should not be encoded to a +, instead it should be encoded with %20. Replace your + with %20.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文