Developing a password-protected authentication scheme for accessing XML files over the WWW
A project I'm doing for a client "requires" (as in, that's their preference) an RSS feed to be accessible only by authentication. The client isn't technical, and only wants some sort of exclusivity built-in to not make the XML data contained within truly public. It's a giveaway promotion over the radio, so if a few people manage to crack the authentication and access the XML data, no biggie - it's just podcastable MP3 files. As such, the "password" is justa randomly-generated string of characters (5 numerics, 5 alphabetics).
Here's the pseudocode I'm working with in ASP.NET 1.x:
- Develop a simple login page - LOGIN.ASPX - requiring a user to enter a password into a TextBox control
- Use a regular expression in a RegularExpressionValidator control against the TextBox to ensure the string has 5 numbers and 5 letters (note this isn't validating against a store of genuine passwords, so actually, the more people to crack it, the better). It's basically nothing more than a faux security mechanism that calls Response.Redirect() if the password is in the right format.
- Use a .ASPX page - BONUS.ASPX - with the Response.ContentType property set to "text/xml", so that code can evaluate the previous page by looking at the referring page. If it's not LOGIN.ASPX, redirect to that page, thus programmatically ruling out direct browsing to the file.
- TODO: figure out how to keep the XML data away from search engines and indexes.
Anyone have any better ideas? This again isn't true bulletproof authentication, so it's deliberately got loopholes.