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

时光怂恿深爱的人放手 提交于 2020-02-05 02:34:14

问题


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.

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.

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. Its called 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?

Any help would be invaluable.


回答1:


According to my research, the UserDelegationKeyCredential class is only used for generation of user delegation 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.



来源:https://stackoverflow.com/questions/59768725/creating-a-blobserviceclient-in-azure-sdk-for-js-with-jwt-accesstoken

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!