Our services are authenticated via an auth cookie that must be sent on every request. How can I attach the cookie to the http requests coming from the WPF report viewer?
3 Answers, 1 is accepted
0
Todor
Telerik team
answered on 23 Jan 2018, 04:16 PM
Hi,
I will suggest you to use RestServiceConnectionInfo(string uri, string token) constructor to create the connection string to be used with the REST service. This way you will set up an Authorization Token that would be added automatically to the header with each request to the REST Service. The code can be added in the viewer constructor, after the call to the InitializeComponent() method.
public ReportViewerWindow1()
{
InitializeComponent();
this.ReportViewer1.ReportEngineConnection = new Telerik.ReportViewer.Common.RestServiceConnectionInfo("RestServiceUrlHere", "AuthCookieHere").ConnectionString;
}
Regards,
Todor
Progress 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
If I'm understanding correctly, this won't actually send a cookie with the request but rather a header. We'd need to extract that header value (presumably the auth cookie string value) and decode/decrypt into an auth cookie on the server, then authorize. If there isn't a simple way to send a cookie, then I think this could work. Thanks, I'll let you know if I run into any issues.
0
Todor
Telerik team
answered on 26 Jan 2018, 01:36 PM
Hello Aleksandar,
Yes, this would indeed be a request header.
You cannot send a cookie directly from the WPF Report Viewer.
Regards,
Todor
Progress 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