JWT in ReportViewer

Posted by: bparke on 6 December 2017, 3:17 pm EST

    • Post Options:
    • Link

    Posted 6 December 2017, 3:17 pm EST

    Hello, we are attempting to use the ReportViewer within our application, but we require using JWT and applying some request headers for every request sent back to the api. We attempted to use an interceptor but it appears that maybe the ReportViewer uses Http instead of HttpClient and thus the interceptor isn’t being hit. Is there another way to get the ReportViewer to add some request headers?

  • Posted 7 December 2017, 9:27 am EST

    Hi,

    You can pass the parameter along with report using queryLoadingData event. Please refer to the attached sample for the same.

    ~ManishReportViewer_parameter.zip

  • Posted 7 December 2017, 11:35 am EST

    Hi Manish,

    Can you provide an example of passing an HTTP Header in the request. It’s not clear from the sample how we might do that.

  • Posted 11 December 2017, 5:40 am EST

    Hi,

    We are sorry, we do not have any sample for the same. We have forwarded your request to the concerned team for further investigation with internal tracking id 300289.

    We will let you know as we get any update on this.

    ~Manish

  • Posted 13 December 2017, 1:46 pm EST

    Thank you. Any new information yet? To be clear, we are needing to attach additional HTTP headers with each request that the Wijmo Report Viewer sends back to the Component One API so that we can authenticate the requests.

  • Posted 14 December 2017, 7:56 am EST

    Hi,

    The issue is still with the development team for further investigation.

    ~Manish

  • Posted 19 December 2017, 6:52 pm EST

    Hi Manish,

    Any update on this topic?

    Thanks,

    Bryan

  • Posted 20 December 2017, 7:41 am EST

    HI Bryan,

    We are sorry for the inconvenience.

    This issue is under investigation with the team. We will let you know as we get any update.

    ~Manish

  • Posted 6 January 2018, 7:05 am EST

    Hi,

    You can take an idea from the following library to inject token into the XMLHttpRequest:

    https://www.npmjs.com/package/fs-jwt-xhr-hook

    https://github.com/AlbertFazullin/fs-jwt-xhr-hook

    It can be used like this:

    var hook = new TokenHook();
    hook.installHook(/^http:\/\/demos.componentone.com\/ASPNET\/c1webapi/, function(xhr) {
      if (xhr.readyState == 1) {
          xhr.setRequestHeader('Authorization', 'token');
      }
    });
    
    ...
    
    <ReportViewer initialization>
    
    

    ~Manish

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels