Custom authentication token in HTML5 viewer Q1 2016

4 posts, 0 answers
  1. Dennis
    Dennis avatar
    1 posts
    Member since:
    Aug 2015

    Posted 09 Feb Link to this post

    Hi

    In the release history i have just seen that there is now support for custom authentication token in HTML5 viewers available. How to set the authentication token? Are any examples out there?

     

    Thanks for your help. :)

  2. Nasko
    Admin
    Nasko avatar
    909 posts

    Posted 09 Feb Link to this post

    Hello Dennis,

    You can set the authentication token through the report viewer options.

    HTML5 Report Viewer:
    <script type="text/javascript">
        $(document).ready(function () {
            $("#reportViewer1")
                .telerik_ReportViewer({
                    serviceUrl: "api/reports/",
                    authenticationToken: "myAuthToken",
    ...

    MVC Report Viewer:
    @(Html.TelerikReporting().ReportViewer()
            .Id("reportViewer1")
            .ServiceUrl(Url.Content("~/api/reports/"))
            .AuthenticationToken("myAuthToken")
    ...

    HTML5 Report Viewer for WebForms:
    this.reportViewer1.AuthenticationToken = "myAuthToken";


    Regards,
    Nasko
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. DevCraft banner
  4. Aleksandar
    Aleksandar avatar
    4 posts
    Member since:
    Nov 2015

    Posted 01 Dec in reply to Nasko Link to this post

    Hi.

     

    We did as you described. And it sends token for the most resources, but some how does not for the follwoing url:

    GET /api/reports/clients/173901-cdb6/instances/173902-9976/documents/173902-d1da173902-1f2a/resources/expand.png/

    I assume it's expand icon for a cross tab component.

    Is it a bug ? We need to identify users in order to assign appropriate connection string. (Different users work with different databases)

    Problem is that this reqeust hits ReportController in the backend but we cannot create ReportServiceConfiguration in the ReportController constructor. 

     

     

    var configSectionConfigurationInstance =
    new Telerik.Reporting.Services.ConfigSectionReportServiceConfiguration
    {
    HostAppId = "MyApp",
    ReportResolver = new CustomReportResolver(),
    Storage = new Telerik.Reporting.Cache.MsSqlServerStorage(currentUser.Client.DatabaseConnection)
    };

    this.ReportServiceConfiguration = configSectionConfigurationInstance;

     

    Request has no token as theresult we don't knwo current user and cannot set the connection string

  5. Stef
    Admin
    Stef avatar
    3053 posts

    Posted 4 days and 3 hours ago Link to this post

    Hi Aleksandar,

    Please check my reply in your forum thread on the same question.
    We will appreciate it to continue the discussion in one of both threads in order to keep a better track on the exchanged information.

    Thank you for your understanding.

    Regards,
    Stef
    Telerik by Progress
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top