0

I am making calls to a WCF service using dataJS.

As shown in the code below, I pass through Username and Password, but when debugging or monitoring the request on Fiddler, I see no authorization header or any trace of the username and password.

var url = "http://localhost/myServices/myService.svc/aMethod";

OData.defaultHttpClient.enableJsonpCallback = true;

OData.request(
        {requestUri: url, method: "GET", user: 'Joe', password: 'Soap' },
        function (data, request) {
            // successful
        },
        function (error) {
            // error
        }
)

The reason I need to get the username and password is so I can use it in my custom basic authentication module.

Any assistance is appreciated.

Thanks

Dave
  • 351
  • 3
  • 12
  • In most HTTP Authentication schemes, the client doesn't send credentials until the server challenges the client to provide such credentials using a HTTP/401 challenge with an WWW-Authenticate header that outlines what auth schemes the server is willing to accept. – EricLaw Nov 14 '12 at 22:04
  • don't you mean OData.read( { ... } ); ? – x0n Jan 01 '13 at 04:48
  • solution to this problem is to pass username and password in headers refer this [example](http://stackoverflow.com/a/44021121/6396645) – Gauri Bhosle May 17 '17 at 10:12

0 Answers0