Axel
Axel

Reputation: 68

ASP.NET - Cron job with password protected page

I am trying to read an xml-feed into a database on a specific time with cron jobs. Everything is working fine (the cron job calls the page and the xml-script starts running and reading into the database) except that i dont want someone else to be able to run the script by visiting this page. Therefore I have been looking at setting up a password-protected page for this script, but there is not a lot of information about how to do this with cron jobs and asp.net.

It seems to be so much easier with php (use the htaccess-file and send the username and password with the cron-job url like http://username:[email protected]/cron). Is it possible to do this with asp.net sites?

I have to use cron job since my web hosting provider don't have windows task scheduler.

Thanks, Axel

Upvotes: 0

Views: 355

Answers (2)

Ratna
Ratna

Reputation: 2319

Two points come to my mind

  1. http://username:[email protected]/cron like url is useless for securing if https is not used. You can make you asp.net url equivalent to it using query string.
  2. If ssl is not possible why dont you enable ip checking that the code will only run when the page is requested from a specific ip(Linux server ip)??

Upvotes: 0

Yordan Georgiev
Yordan Georgiev

Reputation: 5440

you could use pass protected url in dir specific web.config

Upvotes: 0

Related Questions