This is a migrated thread and some comments may be shown as answers.

Custom authentication token in HTML5 viewer Q1 2016

3 Answers 376 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Dennis
Top achievements
Rank 1
Dennis asked on 09 Feb 2016, 09:50 AM

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. :)

3 Answers, 1 is accepted

Sort by
0
Nasko
Telerik team
answered on 09 Feb 2016, 01:25 PM
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
0
Aleksandar
Top achievements
Rank 1
answered on 01 Dec 2016, 04:56 PM

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

0
Stef
Telerik team
answered on 05 Dec 2016, 05:34 PM
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
Tags
General Discussions
Asked by
Dennis
Top achievements
Rank 1
Answers by
Nasko
Telerik team
Aleksandar
Top achievements
Rank 1
Stef
Telerik team
Share this question
or