hoe to configure the Authentication Token in Reports controller

1 Answer 44 Views
.NET Core Report Viewer - Angular Rest Service
Pragati
Top achievements
Rank 1
Pragati asked on 27 Jan 2025, 09:37 AM

Hello,

I am using the Telerik Angular Report Viewer and Reporting REST service to configure Telerik Reporting. However, I am unable to obtain the authorization token needed to set the connection string. I have implemented the Telerik custom report source resolver in my application. After reading a few articles, I learned that the authorizationToken can be set in the HTML file. However, I am unsure how to apply this token in my report controller or within my custom source resolver.

Telerik angular viewer :

<div class="modal fade show full-width" tabindex="-1" role="dialog" style="display:block">
            <div class="viewer-container">
                <tr-viewer #viewer1
                                     [containerStyle]="viewerContainerStyle"
                                     [serviceUrl]="msServiceURL"
                                     [reportSource]="mobjReportSrc"
                                     [viewMode]="'CONTINUOUS_SCROLL'"
                                     [scaleMode]="'FIT_PAGE_WIDTH'"
                                     [scale]="1.0"
                                     [ready]="ready"
                                     [viewerToolTipOpening]="viewerToolTipOpening"
                                     [enableAccessibility]="false"
                                     [keepClientSideReportInstance] = "true"
                                     [authenticationToken] ="strToken"> </tr-viewer>
            </div>

</div>

Report controller -

[Route("api/BME/[Controller]")]
[ApiController]
public class ReportsController : ReportsControllerBase
{
    public int ClientSessionTimeout { get; set; }
    public ReportsController(IReportServiceConfiguration reportServiceConfiguration, IConnectionFactory connectionFactory)
        : base(reportServiceConfiguration)
    {

    }

 

Thank You,

Pragati

 

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 29 Jan 2025, 03:32 PM

Hi Pragati,

Thank you for the shared code and the additional information!

I see that you have already implemented the passing of a token in the HTML code through the authenticationToken property.

Now, to authorize the controller, you can follow the instructions from the Setting up authorization in Reporting REST Service controller - Telerik Reporting KB article.

Please try the suggested approaches in the article and let me know if you need further assistance.

Regards,
Dimitar
Progress Telerik

Stay tuned by visiting our roadmap and feedback portal pages, enjoy a smooth take-off with our Getting Started resources, or visit the free self-paced technical training at https://learn.telerik.com/.
Tags
.NET Core Report Viewer - Angular Rest Service
Asked by
Pragati
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or