using angular and am trying to pass in a bearer token using an odata source with a devextreme dxdatagrid and I can't get it to authenticate and pull data, keeps returning "Current user did not login to the application!", indicating it's not authenticating.
I can successfully emulate the call using postman. DataSource definition below:
constructor(
injector: Injector,
private _route: ActivatedRoute,
private _router: Router
) {
super(injector);
let authString = "Bearer " + getToken();
this.gridDataSource = {
store: {
type: 'odata',
key: 'Id',
keyType: "Int32",
version: 4,
url: 'http://localhost:21021/odata/Roles'
},
select: [
'Id',
'Name',
'DisplayName'
],
beforeSend: (e) => {
e.headers = {
"Content-Type": "application/json",
"Authorization": authString
}
}
}
}
I'm assuming I have the beforesend header definition incorrectly formatted, any help much appreciated