This is a migrated thread and some comments may be shown as answers.

WCF Data Service / Grid - Authentication Problems

3 Answers 95 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Jason
Top achievements
Rank 1
Jason asked on 14 Jun 2012, 03:04 PM
Kendoui,

I have built a data service using .NET (windows authentication behind it).  I can query the web service fine in a browser, via a normal jquery call (none Kendoui template) but when I come to use the service from the Kendoui Grid sample I do not receive back any rows.

How can I pass authentication through to the web service?  I have used Kiddler and it is stating no WWW-Authentication headers are present etc.

Thanks.

3 Answers, 1 is accepted

Sort by
0
Iliana Nikolova
Telerik team
answered on 18 Jun 2012, 08:46 AM
Hello Jason,

Could you please provide more details regarding the way the jQuery call is used? By design, the DataSource uses $.ajax and I believe you could use the same approach to pass the authentication.
  
Regards,
Iliana Nikolova
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Jason
Top achievements
Rank 1
answered on 18 Jun 2012, 08:53 AM
This is the jQuery used which works:

<script type="text/javascript">


        $(document).ready(function () {


            var qry = "http://localhost:59154/ODATA2/WcfDataService2.svc/Call?$top=10";


            $('#loadData').click(function () {


                $('#status').text("Loading Sales …");


                $.getJSON(qry, function (results) {


                    $.each(results.d, function (i, item) {


                        var line = "<div>" + item.Sales + "</div>";


                        $('#sales').append(line);


                    });


                });


            });


        });


</script>


<a href="#" id="loadData">Load Data</a>
<div id="status"></div>
<div id="sales"></div>
0
Iliana Nikolova
Telerik team
answered on 21 Jun 2012, 08:08 AM
Hi Jason,

By design, the Kendo UI DataSource with ODATA protocol sends JSONP request. From the provided code snippet it seems that you try to return JSON. Please note that in this case you need to configure the dataSource to return dataType: "json". In case this is correctly implemented, I will need a small but runnable project that could be examined in details. This way I would be able to observe the problem and advice you further.

Greetings,
Iliana Nikolova
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Data Source
Asked by
Jason
Top achievements
Rank 1
Answers by
Iliana Nikolova
Telerik team
Jason
Top achievements
Rank 1
Share this question
or