Add JWT token for authentication when sending request to backend

Hi there,
When I open a doc in the Angular DocumentEditor, the 'Import' traffic is not intercepted by Angular Interceptor (while all others are). I'm wondering if there is a way to add the JWT bearer token to the header so that the request can be authenticated. Thanks.
Best,
Le

3 Replies 1 reply marked as answer

SR Stephen Raj Chandra Sekar Syncfusion Team November 10, 2020 07:00 AM UTC

Hi Le, 
 
You can change access token by adding custom headers for XMLHttpRequest to headers property of DocumentEditorcontainer. The client-side code will send the token back to the server for every subsequent request which needs server-side interaction. You can also refer below documentation link. 
 
 
containerInstance.headers = [{‘<add custom header here>’: ‘<add token here>’ }]; 
 
If this does not satisfy, kindly share your requirement. 
 
Regards, 
Stephen Raj

Marked as answer

LE Le November 11, 2020 02:50 AM UTC

This is what I need. Thanks for the help, Stephen Raj!

Best,
Le


PN Preethi Nesakkan Gnanadurai Syncfusion Team November 11, 2020 05:20 AM UTC

Hi Le, 
  
Most welcome. 
  
Regards, 
Preethi 


Loader.
Up arrow icon