How to use TWebDataGrid with passing bearer jwt token to get data?

Hi,

We are thinking to use the latest TWebDatagrid component in our webcore app.
I checked with binding sample data by using DGXDataRestDataAdapter component with assigning URL and Entity. It works great but I could not find any option to pass Bearer jwt token with API URL.

We have API developed in xdata with JWT middle-ware. So it did not allow to get the data by using DGXDataRestDataAdapter URL with showing unauthorized access.

So how to pass bearer token also by using DGXDataRestDataAdapter component to get data for Webdatagrid.

And also found, that it only works with Entity models, so can we get data from normal service endpoints like follow. if so how?

type
  [ServiceContract]
  [Route('customers')]
  IcustomerService = interface(IInvokable)
    ['{CCCF41C9-19AB-4DD1-AD04-166E94039879}']

    [HttpGet, Route('')]
    function GetCustomers(showall: boolean; repid: integer; custno: string; searchtext: string; livestatus: integer): TList<TCustomer>;

@Pieter

We are investigating the best approach to do so.

Thank you. Bruno. I appreciate your efforts.

At this moment, you'd need to do this by implementing TDGCustomDataAdapter where you implement OnGetRows, OnUpdateRow, OnDeleteRow, OnInsertRow, and OnLoadSchema and in this code add the bearer.

To avoid this and make it easier, we extended TDGXDataRestDataAdapter with a RequestHeaders property so you can insert the Bearer from there. This will be included in the next release.