I have a server-side OData API which uses OAuth2 BearerToken authentication (OIDC).
Client-side I am using the MSAL-angular (https://www.npmjs.com/package/@azure/msal-angular) library to implement authentication. This library depends on HttpInterceptor (the standard angular way to include e.g. Bearer tokens).
However, the DevExtreme ODataContext requires the implementation of an beforeSend method which is quite archaic... I mean the Bearer-Token is nothing static. In the OIDC world we have to perform silent login requests, access token renewals, and so on.
Without MSAL I am quite lost - no way to implement all those things manually... But with MSAL I cannot use the DevExtreme OData store...
So how I am supposed to solve this problem - use the DevExtreme OData store with HttpInterceptor?
DevExtreme DataLayer components are not based on HttpClient. That is why, you cannot use HttpInterceptor for this task. We are researching the capability of integrating HttpClient into DevExtreme for angular components. However, I cannot provide you with any promises or estimates here. Once we find an appropriate solution, we will add it to DevExtreme.
Should you have any other questions, feel free to ask. We are here to help.
Thank you for the update. In this case, you can try handling onDataErrorOccurred and/or errorHandler. Then, in the event handler, check the error message and resend a request using the gridInstance.refresh() method. Then, according to the received error, you will be able to change your request parameters in the beforeSend callback.