POST from jQuery to Spring MVC boot needs user credentials
I need to do jQuery.POST with user credentials in order for Spring Server Security to accept the request.
After googling, I haven't found a "possible solution".
This is the solution (doesn't work) which seems to be the closest thing to a real solution.
$.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);
}
});
How should I fix this code to add User Credentials to work with Spring MVC Security.
+3
source to share