gpt4 book ai didi

angular - 通过 Azure 广告对 Angular 中的用户进行身份验证并授权 Blob 存储

转载 作者:行者123 更新时间:2023-12-03 05:31:37 24 4
gpt4 key购买 nike

我用 Angular 构建了一个应用程序,我希望经过身份验证的用户能够根据其访问权限下载文件,为此我尝试使用 Azure AD 和 azure rbac 进行身份验证和授权,并使用 azure blob 来存储我的文件,我在互联网上搜索了很多,虽然我遇到了有关如何通过 msal 库进行身份验证的解决方案,但我没有找到任何有关如何对用户进行身份验证和授权用户使用 blob 存储的解决方案,我非常感谢许多说明或教程来解决这个问题。此致 ,加仑

最佳答案

你的代码在浏览器中运行吗?目前浏览器 @azure/blob-storage 仅支持using SAS token

BlobServiceClient 构造函数执行 take a TokenCredential ,这是您可以实现的接口(interface):

https://learn.microsoft.com/en-us/javascript/api/@azure/core-auth/tokencredential?view=azure-node-latest

向 Azure Blob 服务发送请求时,SDK 库将使用提供的 token 作为承载 token 。不过我还没有尝试过使用 RBAC。

希望 future SDK能够更好地与浏览器的AAD/RBAC集成。

关于angular - 通过 Azure 广告对 Angular 中的用户进行身份验证并授权 Blob 存储,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64974615/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com