Azure-Samples/active-directory-javascript-nodejs-webapi-v2

Documentation

ubreddy opened this issue · 2 comments

Tried what is mentioned in documentation.

localhost:5000/hello responds with 401 Unauthorized.

Tried these scenarios too.

  1. Changing the realm to the directoryID from "common"
  2. Changing the reply URL of the application in AD to localhost:5000/

Not sure what steps are missing to correct this error. Is there a client secret to be used?

@ubreddy Set loggingLevel to 'info' (https://github.com/Azure-Samples/active-directory-javascript-nodejs-webapi-v2/blob/master/index.js#L15), and run the app, you will see the error message at the terminal where you run node.

I'm an AAD newbie and this sample is rather confusing. How do we obtain a token? Are we expected to create a client that attaches the auth header ourselves? If so, it would seem like this sample is incomplete.