简体   繁体   English

使用 JWT accessToken 在 azure-sdk-for-js 中创建 blobServiceClient

[英]Creating a blobServiceClient in azure-sdk-for-js with JWT accessToken

When migrating from v2 to v10 version of a azure SDK javascript library , we have been facing an issue.azure SDK javascript 库的v2版本迁移到v10版本时,我们遇到了一个问题。 We need to create a blobServiceClient using the JWT accessToken that has been received from acquireTokenWithAuthorizationCode function in the adal-node library.我们需要创建一个blobServiceClient使用JWT accessToken已从收到acquireTokenWithAuthorizationCode功能在阿达尔节点库。

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. SimpleTokenCredential类已从azure-sdk-for-js 中删除,因此无法实例化。

Going, through the javascript source code for the azure-sdk-for-js library I found an option that could be useful for us but I am not sure of it.通过azure-sdk-for-js库的 javascript 源代码,我发现了一个可能对我们有用的选项,但我不确定。 Its called UserDelegationKeyCredential .它称为UserDelegationKeyCredential

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?如果这不是类,那么应该使用哪个其他KeyCredential类来实现我们的目的?

Any help would be invaluable.任何帮助都是无价的。

According to my research, the UserDelegationKeyCredential class is only used for generation of user delegation SAS.根据我的研究, UserDelegationKeyCredential类仅用于生成用户委托 SAS。 For more details, please refer to the document更多详情请参考文档在此处输入图片说明

Regarding how to create user delegation SAS, please refer to https://docs.microsoft.com/en-us/rest/api/storageservices/create-user-delegation-sas .关于如何创建用户委托 SAS,请参考https://docs.microsoft.com/en-us/rest/api/storageservices/create-user-delegation-sas

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法使用 Preview 4 azure-sdk-for-js 创建ChatThread() - Can't createChatThread() with Preview 4 azure-sdk-for-js 使用 Bearer 令牌和 azure-sdk-for-js - Using Bearer tokens along with azure-sdk-for-js 无法使用 azure-sdk-for-js 使用 Angular 访问 Azure Data Lake Gen2 的文件系统 - Unable to access FileSystem of Azure Data Lake Gen2 with Angular using azure-sdk-for-js Azure - 使用 MSAL 生成可用于访问 BlobServiceClient 的 AccessToken - Azure - Use MSAL to generate AccessToken which can be used to access BlobServiceClient 使用带有 Python V12 SDK 的 BlobServiceClient 将本地文件夹上传到 Azure Blob 存储 - Upload local folder to Azure Blob Storage using BlobServiceClient with Python V12 SDK 未能验证 BlobServiceClient 和 Azure AD - Failing to authenticate BlobServiceClient and Azure AD Azure使用节点js Sdk创建虚拟机 - Azure creating virtual machine using node js Sdk Azure BlobServiceClient 给出导入错误(偶尔) - Azure BlobServiceClient gives import error (occasionally) 使用 JWT python sdk 对 azure 广告进行身份验证 - Authenticate to azure ad with JWT python sdk Azure SAS 令牌不适用于 Azure.Storage.Blobs BlobServiceClient - Azure SAS Token not working with Azure.Storage.Blobs BlobServiceClient
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM