A token is required for a secure communictation with the application server. You can generate a token with the following AJAX-Request
var token = null;
$.ajax("http://localhost:8080/genToken/client/1.0", {
method: 'GET',
headers: {'Authorization': '[Authorization]' // [userName] : [userPassword]},
success: function(data) {
if (!data.result) {
alert("Error retrieving token: " + data.message);
return;
}
token = data.result;
}});
[userName]
The name of the user as String.
[userPassword]
The passsword of the respective user as String.
[Authorization]
The authorization data required for identification. Consisting of the authorization method here the String Basic and the [userName]:[userPassword] as a Base64 encoded String.