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

Digest authentication fails if http method is provided via options #1412

Closed
dbellavista opened this issue Feb 6, 2015 · 2 comments · Fixed by #1413
Closed

Digest authentication fails if http method is provided via options #1412

dbellavista opened this issue Feb 6, 2015 · 2 comments · Fixed by #1413

Comments

@dbellavista
Copy link

I'm building a client/server application with nodejs. The server uses express and passport and has API protected with Diget authentication. The client uses request.

The following operation is unable to authenticate:

  request({
    method: 'get',
    uri: 'http://127.0.0.1:8066/api/test',
    auth: {
      user: 'myuser',
      pass: 'mypass',
      sendImmediately: false
    }
  }, function(err, resp, body) {
    console.log(resp.statusCode);
    console.log(body);
  });

However, the following code works:

  request.get({
    uri: 'http://127.0.0.1:8066/api/test',
    auth: {
      user: 'myuser',
      pass: 'mypass',
      sendImmediately: false
    }
  }, function(err, resp, body) {
    console.log(resp.statusCode);
    console.log(body);
  });

I was expecting the operations to be equivalent. Am I doing something wrong?

@simov
Copy link
Member

simov commented Feb 6, 2015

This might be related to #1409 so I'm going to test this case as well.

@dbellavista
Copy link
Author

If you need a code snippet let me know

simov added a commit to simov/request that referenced this issue Feb 7, 2015
Check for Auth instance value in basic-auth tests
Closes request#1409
Closes request#1412
@simov simov mentioned this issue Feb 7, 2015
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

Successfully merging a pull request may close this issue.

2 participants