0

I've a Wcf Service Application with jsonp that I consume using jquery like this:

    function CallService() {
        $.ajax({
            type: Type, //GET or POST or PUT or DELETE verb
            url: Url, // Location of the service
            data: Data, //Data sent to server
            contentType: ContentType, // content type sent to server
            dataType: DataType, //Expected data format from server
            processdata: ProcessData, //True or False
            success: function (msg) {//On Successfull service call
                ServiceSucceeded(msg);
            },
            error: ServiceFailed// When Service call fails
        });
    }

I've hosted the WCF Service using IIS 5.1 and now I want to use the Windows Authentication parameter.

What do I've to do in jquery for this to work?

1 Answer 1

2

I guess you need to implement www-authentication for your service:

Adding basic HTTP auth to a WCF REST service

then, according to the jQuery documentation, you can make authenticated ajax calls by setting the username and password variables accordingly:

http://api.jquery.com/jQuery.ajax/

Sign up to request clarification or add additional context in comments.

2 Comments

for example, I may use basic authentication with https? is this correct?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.