How can i login and get the access token for my blockchain workbench api using node js?

auricio 21 Reputation points
2021-01-25T02:40:36.847+00:00

I tried to use the same access token that I receive during authentication, however when using it in the workbench api I received the message saying unauthorized.

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
40,389 questions
{count} votes

1 answer

Sort by: Most helpful
  1. AshokPeddakotla-MSFT 35,171 Reputation points
    2021-01-25T11:54:45.217+00:00

    @auricio We are sorry to hear that you are having issues with access token. Looks like your access token is expired.

    Did you follow the instructions at this tutorial: https://github.com/Azure-Samples/blockchain/tree/master/blockchain-workbench/auth-samples for getting the token?

    You can use the Rest API samples to interact with Workbench APIs: https://github.com/Azure-Samples/blockchain/tree/master/blockchain-workbench/rest-api-samples

    As per you query, if you are trying to access our API programmatically you can create a service a service principal to access work bench API and by using an AAD library (available in many languages) to generate the bearer token. Here an example for NodeJS

    If an answer is helpful, please "Accept answer" or "Up-Vote" for the same which might be beneficial to other community members reading this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.