Issuing a WebRequest to a backend page

Posted by Community Admin on 04-Aug-2018 17:07

Issuing a WebRequest to a backend page

All Replies

Posted by Community Admin on 25-Mar-2014 00:00

I need to be able to issue a WebRequest to get the responsestream from a backend SF page...

 So the problem I'm having is that (clearly) it's responding back with the /Sitefinity login page html and not the ACTUAL backend page markup.

Do I have to log in as someone and pass that along with the request somehow?

 

Posted by Community Admin on 28-Mar-2014 00:00

Hi Steve,

You are on the right track. The WebRequest gets redirected to the login page due to the fact that there is no identity logged in. In order for it to pass its actual parameter, you will either need to get the currently logged user using:

ClaimsManager.GetCurrentIdentity();
or by authenticating a user of your choosing using:
SecurityManager.AuthenticateUser(UserManager.GetDefaultProviderName(), "UserName", "Password", false);


Regards,
Ivan D. Dimitrov
Telerik
 
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
 

Posted by Community Admin on 28-Mar-2014 00:00

Would that still work in the context of a ScheduledTask?

Posted by Community Admin on 31-Mar-2014 00:00

Hi Steve,

In the case of a scheduled task I would advise the second method of doing this, as well as using a dummy user. This is done because you cannot ensure that the CurrentIdentity Auth cookie will not have expired by the time the task needs to trigger.

Regards,
Ivan D. Dimitrov
Telerik

 
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
 

This thread is closed