Skip to content
This repository has been archived by the owner on Aug 7, 2021. It is now read-only.

Token not working for NodeJS #237

Closed
AlexisVirgen opened this issue Jul 8, 2020 · 2 comments
Closed

Token not working for NodeJS #237

AlexisVirgen opened this issue Jul 8, 2020 · 2 comments

Comments

@AlexisVirgen
Copy link

AlexisVirgen commented Jul 8, 2020

Hi Im trying to get access to an API using a bearer token, using the adal function acquireTokenWithClientCredentials. I received token successfully, but when I try to use it for the API it doesnt work.

Its weird because if I retrieve the token using the same adal function (using the same credentials and API) but with Python, the token works. I dont know if there is a problem with my AAD or something, but I've done this with the Python adal module with no problem, using exactly the same apparently for the adal nodejs version doesnt work. I can generate two tokens using the same credentials and same function, one with Python and the other with NodeJS, and only the Python one works.

@AlexisVirgen
Copy link
Author

The problem was in the token response, the resource is returned with spn:{id}. The solution is address here: AzureAD/azure-activedirectory-library-for-python/issues/54

@sameerag
Copy link
Member

Did you get a chance to migrate to msal-node? We have a migration guide published here which can help you do that.

Since ADAL is reaching end of life, as mentioned in the guidance, we would like to address any applicable issues on msal-node. Please give it a spin and let us know. If you are still facing an issue, please feel free to open an issues against the new. repo.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants