使用JWT accessToken在azure-sdk-for-js中创建blobServiceClient [英] Creating a blobServiceClient in azure-sdk-for-js with JWT accessToken

本文介绍了使用JWT accessToken在azure-sdk-for-js中创建blobServiceClient的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当从 azure SDK javascript库 v2 版本迁移到 v10 版本时,我们一直面临着问题.我们需要使用 JWT accessToken 创建一个 blobServiceClient 已从 adal-node 库中的 acquireTokenWithAuthorizationCode 函数接收到.

When migrating from v2 to v10 version of a azure SDK javascript library, we have been facing an issue. We need to create a blobServiceClient using the JWT accessToken that has been received from acquireTokenWithAuthorizationCode function in the adal-node library.

这些选项似乎仅限于我们,示例很少. SimpleTokenCredential 类已从 azure-sdk-for-js 中删除,因此无法实例化

The options seem limited to us and the examples are few. SimpleTokenCredential class have been removed from the azure-sdk-for-js and thus it cannot be instantiated.

通过 azure-sdk-for-js 库的javascript源代码,我找到了一个可能对我们有用的选项,但我不确定它.它称为 UserDelegationKeyCredential .

这是最适合我们工作的课程吗?如果有人可以指出我该课程的用法?如果这不是该类,那么应该使用哪个其他 KeyCredential 类?

Is this the class that is the most suitable for our work/If it is can someone point me to the usage of this class? If this is not the class then which other KeyCredential class should be used for our purpose?

任何帮助都是无价的.

推荐答案

根据我的研究,UserDelegationKeyCredential类仅用于生成用户委派SAS.有关更多详细信息,请参阅

According to my research, the UserDelegationKeyCredential class is only used for generation of user delegation SAS. For more details, please refer to the document

关于如何创建用户委托SAS,请参考

Regarding how to create user delegation SAS, please refer to https://docs.microsoft.com/en-us/rest/api/storageservices/create-user-delegation-sas.

这篇关于使用JWT accessToken在azure-sdk-for-js中创建blobServiceClient的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆