因此,我有这个应用程序,几乎已经完成,但我需要增加一些额外的安全性,因为我不太熟悉一些Asp.Net mvc 5的方法,我有这个问题。
是否可以添加某种加密或类似于some结果的内容?这样做的想法是,如果我通过json发送敏感信息,那么我可以添加什么服务器端来保护它吗?或者MVC5已经处理好了?
下面是一个非常基本的例子
$.ajax({
type: "POST",
url: 'GetImptInfo',
data: { 'Something': Something, 'Something2': Something2}, //this can be anything
dataType: "json",
success: function (result) {
alert('Added');
//do stuff
},
error: function (xhr, ajaxOptions, thrownError) {
//some errror, some show err msg to user and log the error
alert(xhr.responseText);
}
});控制器方法
public JsonResult GetImptInfo(int Something, int Something)
{
//get stuff from the server
var imptInfo = RequestInfo();
return Json(impInfo, JsonRequestBehavior.AllowGet);
}为了保护json,我可以添加什么东西吗?或者我有足够的东西?
发布于 2015-02-16 11:28:10
您可以使用安全协议传输您的信息,即https。您还可以查看这个链接,以了解为什么需要JsonResult:Why is JsonRequestBehavior needed?
https://stackoverflow.com/questions/28540187
复制相似问题