有没有一种方法可以使用名为'代码&#x27的参数。在我的Azure功能中?

发布于 2025-02-12 19:09:32 字数 249 浏览 0 评论 0原文

我正在使用Azure函数作为静态Web应用程序的后端。为了连接到第三方平台,我需要浏览OAUTH授权代码流,其中包括使用Quary参数命名code的第三方调用我的功能。似乎函数将其用于我不使用的某些内部验证目的,并且在达到我的代码之前,我得到了500响应 - 我确定问题是有一个名为code的参数。有没有一种方法可以通过Azure功能来完成这项工作?

我正在使用python来完成我的功能,但我认为这没有相关。

I am using Azure Functions as the back end for a static web app. In order to connect to a 3rd party platform, I need to go through the OAuth Authorization Code flow, which includes the third party calling my function with a query parameter named code. It seems that Functions uses this for some internal auth purposes which I am not using, and I get a 500 response before it even hits my code - I've determined the problem is having a parameter named code. Is there a way to make this work with Azure Functions?

I am using Python for my function but I don't think that's relevant.

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

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

发布评论

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

评论(1

青春有你 2025-02-19 19:09:33

我想出了静态Web应用程序中页面的解决方法,其中一些JavaScript将参数重命名并重定向到该函数:

let url = new URL(window.location)
url.pathname = "/api/redirect" // The url for the function to handle the request
let query = new URLSearchParams(window.location.search)
let code = query.get("code")
query.append("authorization_code", code)
query.delete("code")
url.search = `?${query.toString()}`
window.location = url

I've come up with a workaround of a page in the static web app with some JavaScript that renames the parameter and redirects to the function:

let url = new URL(window.location)
url.pathname = "/api/redirect" // The url for the function to handle the request
let query = new URLSearchParams(window.location.search)
let code = query.get("code")
query.append("authorization_code", code)
query.delete("code")
url.search = `?${query.toString()}`
window.location = url
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文