How do I hide this information as a parameter for the token request? the way that anyone can see and can not
var chaveToken = {
"grant_type": "password",
"username": "[email protected]",
"password": "xxxxxxxxxx@121111"
};
var token;
$.ajax({
url: 'http:/xxxxxx.com.br/token',
async: false,
contentType: 'application/x-www-form-urlencoded',
type: 'POST',
data: chaveToken,
success: function (data) {
token = data.access_token);
}
});
$.ajax({
url: 'http://xxxxxx.com.br/obterlistasreembolso',
async: false,
beforeSend: function (xhr) {
xhr.setRequestHeader('Authorization', 'bearer ' + Token);
},
success: function (data) {
bla bla bla
}
});