Tags:  reactjsaxios
Source:  Twitter logo

I have a WebApi that uses NTLM authentication and I am trying to write a simple React UI to get data from the API but getting 401.

axios.get('url').then(response => console.log(response));

How can I pass my Windows credentials along with the get request?

Thanks

Axios provides a withCredentials property on request. This is false by default, set it to true and you should be good to go.

Axios.get('url', {
withCredentials: true } )
2 users liked answer #0dislike answer #02
Scornwell profile pic
Scornwell

Copyright © 2022 QueryThreads

All content on Query Threads is licensed under the Creative Commons Attribution-ShareAlike 3.0 license (CC BY-SA 3.0).