使用OAuth2.0和Azure函数调用受保护的API
标题表明,我几乎完全迷失了如何使用与HTTP触发器一起使用的Azure功能应用程序正确设置OAuth2.0。
我称为的API不支持隐式流,只允许授权代码流。我最初的计划是关注本指南获得适当的令牌。但是,该客户凭证流不使用重定向URI。
我认为我需要创建一个端点,例如“ https:// {baseaddress}:{portnumber}/api/oauth/token/token”,它可以用作重定向的URI。然后,我可以将令牌存储在服务中,并在需要时使用/刷新它。但是我担心重定向会破坏应用程序的状态,而无法正常工作。
是否有一个具有Azure函数的申请代码赠款流的示例?我非常感谢一些指导/其他资源。
as the title suggests I'm almost completely lost on how to properly set up OAuth2.0 with an Azure function app which works with http triggers.
The API I'm calling does not support implicit flow and only allow the Authorization Code Flow. My original plan was to follow this guide to get the proper token. But this Client Credential flow makes no use of a redirect uri.
I'm thinking I need to create a an endpoint such as "https://{baseAddress}:{portNumber}/api/oauth/token" which can function as the redirect uri. Then I can store the token in a service and use it/refresh it when needed. But i'm concerned that the redirecting will disrupt the state of the application and not work properly.
Is there a demonstarted example of the Applicaiton Code Grant Flow with azure functions? I would very much appreciate some guidance/other resources.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
@anand Sowmithiran建议。这是用于使用基于Azure函数OAuth的授权和使用携带者令牌调用基于外部API的流程。
这是请求授权代码的示例代码。
有关完整信息,您可以检查此 document 。 em>
As suggested by @Anand Sowmithiran. Here is the flow for using Azure function oauth based authorization and calling an external based API using bearer token.
Here is the sample code for requesting Authorization code.
For complete information you can check this document.