Triggering a recurring job after upgrade to version 1.6.20


Some quick background. I write integration tests for our web app that uses hangfire for a few background processes. I need to trigger those background processes sometimes as a part of my test.

These background processes are set as recurring jobs that run every 15 minutes. I opted to trigger the job manually instead of having the test wait for potentially up to 15 minutes.

I was doing this by POSTING the job id to the “hangfire/recurring/trigger” url, and providing basic authentication.

This was working up until we upgraded to version 1.6.20 which introduced antiforgery tokens.

Now after the upgrade my attempts to trigger the job are returning HTTP 403 forbidden.

I can not figure out how to get the call to work again. GET requests to same URL work fine and the antiforgery tokens seem to be getting set.

Can anybody think of a way to make this work?