Last active
September 17, 2015 20:45
-
-
Save normansolutions/6c84c627ea9502e753eb to your computer and use it in GitHub Desktop.
For use on blog post http://normansolutions.co.uk/post/secure-a-webpage-without-a-logon
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@using System.Configuration; | |
@{ | |
string ComplexURLFromWebConfig = ConfigurationManager.AppSettings["ComplexURLQueryString"].ToString().Trim(); | |
@* QueryString sent from url *@ | |
string QueryStringComplexURL = (Request.QueryString["ComplexURLQueryString"] ?? "").ToString().Trim(); | |
if (ComplexURLFromWebConfig != QueryStringComplexURL || Request.Cookies["NSSecureMethodCookie"] == null) | |
{ | |
var data = "Unathorised"; | |
Response.Write(data); | |
Response.End(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment