3
我需要使用Spring服务器安全性需要接受请求的用户凭证创建一个jQuery.POST。从jQuery到Spring引导的MVC MVC需要用户凭证
谷歌搜索后,我没有找到一个“可能的解决方案”。
这是似乎离真正的解决方案最近的解决方案(不起作用)。
$.ajax({ type: 'post', url: urlprova, data: JSON.stringily(respostas), dataType: 'json', contentType: 'application/json', success: function(response) { console.log(response); }, xhrFields: { withCredentials: true }, error: function(error) { console.log('ERROR:', error); } });
我是如何修复该代码添加的用户凭据与Spring MVC的安全工作。
Spring Security配置为使用HTTP基本?如果是这样,试试这个:http://stackoverflow.com/questions/5507234/how-to-use-basic-auth-and-jquery-and-ajax – 2014-11-21 15:09:48
这是一个好主意,但问题是,用户名和密码没有在实际的html页面中(它们在前一个,登录页面中)。你知道我能再次得到他们吗?谢谢 – 2014-11-21 15:14:38