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

401 Unauthorized network error:

1 Answer 318 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Colin
Top achievements
Rank 1
Colin asked on 03 Jan 2012, 08:59 PM

I have no problem to call JSONResult action in Controller from javascript, however, as soon as I deploy the app(same computer), it came out with the 401 errors

js code sample:
ds = new kendo.data.DataSource({
    transport: {
        read: {
            url: ("/Report/GetJsonGroupedCategoryData"),
            type: "POST"
        }
    }
});

Error:
POST http://128.73.0.194/Report/GetJsonGroupedCategoryData
401 Unauthorized
115m

same as GET call:
GET http://128.73.0.194/home/KendoCategoryRead

HTTP Error 401.2 - Unauthorized
You are not authorized to view this page due to invalid authentication headers.



Thanks

1 Answer, 1 is accepted

Sort by
0
Colin
Top achievements
Rank 1
answered on 04 Jan 2012, 04:12 PM
never mind, i have that fixed by providing the basic authentication (to the datasource) before call the action.

xhr.setRequestHeader(“Authorization”, “Basic ” + encodeBase64 (“username:password”)
Tags
Grid
Asked by
Colin
Top achievements
Rank 1
Answers by
Colin
Top achievements
Rank 1
Share this question
or