How to secure plain html pages from unauthorized access.

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
I am using plain html and asp.net web services. The html pages are calling web methods in the asmx through jquery. But how can I secure these pages. For example. In login page I have this ajax request$.ajax({
url:"http://localhost/Service.asmx/Login",
type:"post",
data: {"username":"+username+", "password":"+password+"},
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(result){

var model = JSON.parse(result.d);
if(model.ModelList[0].pkUser != ""){

window.location = "DashBoards/Index.html";
}


},
error: function(){
alert("error");
}

});
The URL "DashBoards/Index.html" can be copied and pasted in the browsers address bar so unauthorized user can go to that page even without logging in. Is there a way to apply a sort of forms authentication/security to these pages?

View the full article
 
Back
Top