But the method is never called, manually going to this url works perfectly.
I can see the following in the log file:
2018-03-06 20:10:21,824 [P20204/D2/T41] INFO Umbraco.Web.Scheduling.ScheduledTasks - memberUnlock has been called with response: False
2018-03-06 20:11:21,861 [P20204/D2/T47] INFO Umbraco.Web.Scheduling.ScheduledTasks - memberUnlock has been called with response: False
2018-03-06 20:12:21,885 [P20204/D2/T48] INFO Umbraco.Web.Scheduling.ScheduledTasks - memberUnlock has been called with response: False
Api controller:
namespace MemberUnlock.Controllers
{
/// <summary>
/// Implement the MemberUnlockApiController
/// </summary>
[PluginController("MemberUnlock")]
public class MemberUnlockApiController : UmbracoAuthorizedApiController
{
/// <summary>
/// Ctor
/// </summary>
public MemberUnlockApiController() { }
[HttpGet]
public void DoUnlock()
{
// Code...
}
}
}
it's because it's Authorized Controller, your scheduled task is not Authorized :)
I don't think there is an option to make it work with authorized controller because of security reasons.
What I usually do it such cases is adding ApiKey (e.g. Guid) in web.config and then pass the same key in scheduled task url and check it inside the action.
Scheduled Task is not working
Hi all,
having some issues with the
ScheduledTasks
from theumbracoSettings.config
file.The following line is added using
IPackageAction
:But the method is never called, manually going to this url works perfectly.
I can see the following in the log file:
Api controller:
Any ideas?
/Michaël
it's because it's Authorized Controller, your scheduled task is not Authorized :)
I don't think there is an option to make it work with authorized controller because of security reasons.
What I usually do it such cases is adding ApiKey (e.g. Guid) in web.config and then pass the same key in scheduled task url and check it inside the action.
is working on a reply...