Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Only one auth mechanism allowed" error where curl is successful instead #860

Closed
giacecco opened this issue Apr 11, 2014 · 7 comments
Closed

Comments

@giacecco
Copy link

If curl is successful doing the following:

curl -L -u '***:***' -o file.gz 'https://datafeeds.networkrail.co.uk/ntrod/CifFileAuthenticate?type=CIF_ALL_FULL_DAILY&day=toc-full'

Why doing the same with request makes the server return this error message: "Only one auth mechanism allowed; only the X-Amz-Algorithm query parameter, Signature query string parameter or the Authorization header should be specified"?

var fs = require('fs'),
    request = require('request');
request('https://datafeeds.networkrail.co.uk/ntrod/CifFileAuthenticate?type=CIF_ALL_FULL_DAILY&day=toc-full', { 
    'auth': { 
        'user': '***',
        'password': '***',
        'sendImmediately': true,
    },
}).pipe(fs.createWriteStream('file.gz'));

In case it was useful, the '-L' option in curl is necessary for it to succeed.

Thanks!

Giacecco

@giacecco
Copy link
Author

It is interesting to add that if I intentionally use a wrong password, I get a "This request requires HTTP authentication (Bad credentials)." error. This means that the authentication is working, at least once, and then the error is returned.

G.

@giacecco
Copy link
Author

Could it be the same problem in issue #450 ?

@medha
Copy link

medha commented Aug 13, 2014

Did you ever find a solution to this? I'm seeing the same issue described here and in issue 450 that you linked.

@giacecco
Copy link
Author

No sorry medha.

G.

@nylen
Copy link
Member

nylen commented Aug 13, 2014

I wrote some of this code, so I'm going to try to find time to look into it this week. In the meantime, a failing test case that doesn't rely on an external server would be extremely helpful.

@nylen nylen self-assigned this Aug 22, 2014
@seanstrom
Copy link
Contributor

@nylen any update on this?
@giacecco do you have a test case we can use without an external server?

@nylen
Copy link
Member

nylen commented Oct 15, 2014

#1058 should fix this. Still planning to get to that this week.

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

No branches or pull requests

4 participants