We are trying to access our own servers using Web Data Source and are having issues with 2 Step Authentication. I have attached the screenshot with this email on how we have set it up, and on final page when we click Download, we get 401 unauthorized.
The same Url and body parameters are working through Postman. I was wondering if you can please help us identify what maybe wrong?
6 Answers, 1 is accepted
I was able to figure this out. Content-Type: Application/json needs to be added as header parameter for this to succeed.
Indeed, Content-Type: Application/json added as a parameter with type Header would retrieve the data. I'm happy that you've already figured it out.
Best Regards,
Silviya
Progress Telerik
I have the R1 2021 version and despite configuring the form for two-step authentication, we still can't get it to connect, it gets a BadRequest error. We attach images of the configuration and the response obtained when invoking the API.
Thanks,
Javier
Hello Javier,
Let me start by answering one of your earlier questions, setting the Content-Type header can be done the following way.
Regarding the error, 400 Bad Request response status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).
Could you please check if the request works as expected with a tool like Postman for example? Are you sure that the data is correct?
Let me know if you have any updates on the isue.
Regards,
Dimitar
Progress Telerik
Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.
Hi all,
I struggled with the same 400 Bad Request and I managed to figure out what was wrong. Hopefully my discovery will help others save time.
First off... yes, make sure your request works with Postman and you are receiving the access token.
If the request works in Postman, but not the Report Designer, you could install Fiddler, enable it temporarily as your System Proxy and monitor the Live Traffic to see the actual request the Report Designer is sending and the response it's receiving. Based on that, hopefully you will get more information and fix the issue.
In my case I was requesting an access token from Azure AD, but my request was not formed properly. The issue was that I was I was sending the client_id, client_secret, grant_type and scope in the body as a JSON. Instead the correct approach is to send them in the body as x-www-form-urlencoded, key value pairs separated by &, as following:
client_id=<clientID>&client_secret=<clientSecret>&grant_type=client_credentials&scope=<scope>
I also added the headers Content-Type: application/x-www-form-urlencoded and Accept: application/json in my request (in the Configure authentication parameters wizard window) and it worked like magic.
Another important thing is to make sure that you are using a correct regular expression for the Token Path, capable of capturing the access token. In my case, with the response from Azure AD the following works great:
(?:"access_token"\s*:\s*")([^"]*)(?:")*