Authentication problem with Adapters.ODataV4Adaptor

Hi. I have a problem with the Authorization Bearer header, I checked the forums and found two ways to do:

  •  HeaderData.Add("Authorization", "Bearer” + “token");
  • HeaderData.Add("Bearer", "token");
I've tried both and the result is the same, an unauthorized 401 response.
Check my request on postman and it works fine.
-

Here is my Control configuration:



* I have not sent both at the same time.

Network:






The weird thing is that I can authenticate the user once the function starts.

It could be a problem with my api, but then why does it work well in postman?

Thank you very much for your attention, I await your response.



1 Reply

RV Ravikumar Venkatesan Syncfusion Team February 18, 2021 09:06 AM UTC

Hi Carlos, 
  
Greetings from Syncfusion support. 
  
Query: “I've tried both and the result is the same, an unauthorized 401 response.”  
  
We have analyzed your query and we understand that you are facing CORS error and 401 error when trying to bind data to Schedule component using ODataV4 adaptor along with Authentication. From the screenshot provided, we found that you have sent the authorization token as a header using the Headers property of DataManager.   
  
Kindly share the following details to validate the reported issue at our end.   
  
  • Share the error details of the ActionFailure event.
  • Are you facing the reported issue during the initial rendering or during a certain action.
  • And also exceptions occur when trying to call Recervacinaries controller. Kindly share more details when are you calling this method /controller?.
  • Share the video demonstration of the issue along with a video demo.
  • If possible share the issue reproducible sample.
The above-requested details will be helpful for us to validate the reported query at our end and provide a solution as early as possible.   
  
Regards, 
Ravikumar Venkatesan 


Loader.
Up arrow icon