http - AngularJS / OAuth 2 transport-layer security -
the oauth service trying response working wrong in code not make request.
$http.post(myurl, 'grant_type=password&username=' + username + '&password=' + password,     headers: { 'content-type: application/x-www-form-urlencoded', 'authorization basic ' + btoa(secretword) }).         success(function (response) {             console.log(response);         }).         error(function (response) {             console.log(response);         });      
you have syntax error, therefore js wont make http post request, try this:
$http.post(myurl, 'grant_type=password&username=' + username + '&password=' + password,     { headers: { 'content-type': 'application/x-www-form-urlencoded', 'authorization': 'basic ' + btoa(secretword) } }).         success(function (response) {             console.log(response.data);         }).         error(function (response) {             console.log(response.status);         });      
Comments
Post a Comment