ej.DataManager with Rest Webapi and Tokens

Hello,
I use the follow "edit grid" Typescript code:
 
 this.dataManager = new ej.DataManager({
            url: apiUrl,
            adaptor:  new ej.WebApiAdaptor(),
   
            updateUrl: apiUrl + "/Put",
            insertUrl : apiUrl + "/Insert",
            deleteUrl : apiUrl + "/Delete",
        });

 this.gridData = this.dataManager;

Controller:


This solution allow me to get/put/delete data from webapi with an apiUrl and without security tokens.



In my solution is implement an authService and using IdentityServer4. The AuthService set the webApi Tokens. How can I use this AuthService with the ej.DataManager? Or how can I give the Tokens to the ej.DataManager?

For example without ej-grid: I can get the data like this: 

import { AuthService } from '../services/auth.service';

constructor(authService: AuthService, apiUrl: string) {
        authService.get(apiUrl ).subscribe(result => {
            this.products = result.json() as IProduct[];
        }, error => console.error(error));

Best Regards
Anis helaoui
 

1 Reply

VN Vignesh Natarajan Syncfusion Team January 26, 2018 04:45 AM UTC

Hi Anis, 

Thanks for using Syncfusion Products. 

We have analyzed your query and we suspect that you want to pass the tokens values to ej.DataManager. we have already discussed this topic in our Knowledge base document. 

Kindly refer the below link for the Knowledge base document 


If we misunderstood your query please get back to us. 

Regards 
Vignesh Natarajan 


Loader.
Up arrow icon