Api behind Basic authentication and NTLM authentication
See original GitHub issueHi, I have api on iis server behind basic windows authentication and i cannot use cors. So I tried to use this module but however I configure it I cannot log into api and I get 401 every time
I tried
server.middleware = proxyMiddleware(
'/api',
{
target: 'API_HOST',
logLevel: 'debug'
}
);
server.middleware = proxyMiddleware(
'/api',
{
target: 'API_HOST',
logLevel: 'debug',
auth: 'LOGIN:PASS'
}
);
server.middleware = proxyMiddleware(
'/api',
{
target: 'http://LOGIN:PASS@API_HOST',
logLevel: 'debug'
}
);
Issue Analytics
- State:
- Created 8 years ago
- Comments:78 (17 by maintainers)
Top Results From Across the Web
Basic Authentication in ASP.NET Web API - Microsoft Learn
IIS supports Basic authentication, but there is a caveat: The user is authenticated against their Windows credentials.
Read more >NTLM Authentication with HTTP Client - NETWORG Blog
It's a suite of Microsoft security protocols intended to provide authentication, integrity, and confidentiality to users. It is widely deployed ...
Read more >Using HTTP basic authentication with the REST API - IBM
Users of the REST API can authenticate by providing their user ID and password within an HTTP header. To use this method of...
Read more >HTTP Authentication - Grafana k6
12 // allow us to authenticate using HTTP Basic Auth. ... 36 // basic auth test API endpoint) ... 8 // "ntlm" as...
Read more >Http Authentication
NTLM is a scheme defined by Microsoft. It is more secure scheme than Basic, but less secure than Digest. NTLM can be used...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That sounds promising.
I noticed the usage of
agentkeepalive
in their example;Did a search on the nuts and bolts of the NTLM Authentication Scheme: ~http://www.innovation.ch/personal/ronald/ntlm.html~ https://web.archive.org/web/20210126065105/http://www.innovation.ch/personal/ronald/ntlm.html
This explains why ‘keep alive’ is needed.
Updated configuration:
thank you everyone for chiming in on this, I realize this is a closed issue but this helped solve an auth/CORS issue I had when trying to hit a MVC .NET 4.6 WebApi app which uses “Windows Authenticaton” and I couldn’t get it to work during development for two reasons (CORS and NTLM not working well with axios).
My code for the proxy middleware is this:
The ending result was webpack/browserSync serving up my ReactJs UI at
http://localhost:3000/
and during dev it would hithttp://localhost:3000/api/values
browserSync would intercept the/api/values
and proxy it to the backend WebApi athttp://codefest.example.gov/Team7/api/values
. This works well, thanks again for all of your inputs.