I've tried this every way I could think of... nothing seems to put the token in the request header. If I set the server to allow anonymous access then the method returns data as expected.
<div id="listView"></div>
<script type="text/x-kendo-tmpl" id="template">
<div class="BoxAthletes">
<h3>#:username#</h3>
</div>
</script>
<script>
var dataSource = new kendo.data.DataSource({
transport: {
read: {
url: "https://wodmodeapi.azurewebsites.net/api/v/p/athletes",
dataType: "jsonp",
//headers: { 'Authorization': 'Bearer 5bY8Ot8X-m4tYoF_rjVjFdYwtt_LQfzS6yqgy-c4jzUzDxwnajRKChNU7m_NxSbu4eaLQAoMzNc-lPBvIUWaZdIeACabECoK44QdU8fnlrJAkdBa9aQiCTUuxUhuAL1VWQv5T-OfALPGFA96E9Y0-ZBxwZlhawVHcWDRGP2378WzF3gX35L1c5d0k_5KegT97t7-_fOTakLWN4kCk6QwG_-gSCGoBTSjktl5tKGXXgE' }
beforeSend: function (req) {
req.setRequestHeader("Authorization", "Bearer 5bY8Ot8X-m4tYoF_rjVjFdYwtt_LQfzS6yqgy-c4jzUzDxwnajRKChNU7m_NxSbu4eaLQAoMzNc-lPBvIUWaZdIeACabECoK44QdU8fnlrJAkdBa9aQiCTUuxUhuAL1VWQv5T-OfALPGFA96E9Y0-ZBxwZlhawVHcWDRGP2378WzF3gX35L1c5d0k_5KegT97t7-_fOTakLWN4kCk6QwG_-gSCGoBTSjktl5tKGXXgE");
}
}
},
schema: {
model: {
id: "id",
fields: {
id: { type: "number" },
email: { type: "string" },
username: { type: "string" },
tagline: { type: "string", nullable: true },
url: { type: "string", nullable: true },
created_dt: { type: "date" },
edited_dt: { type: "date" },
birth_dt: { type: "date" },
crossfit_dt: { type: "date" },
gender: { type: "string" },
img_guid: { type: "string" },
score_privacy: { type: "string" },
banned_flag: { type: "number" }
}
}
}
});
$("#listView").kendoListView({
dataSource: dataSource,
pageable: true,
template: kendo.template($("#template").html())
});
</script>