I try like this:
$http({ method: \'POST\', url: \'/token\', data: { username: $scope.username, password: $scope.password, grant_type: \'password\' } }).success(f
You can always watch for the requests being made using the developer console in your browser and see the difference in the request.
But by looking at your jquery code &grant_type=password
is being passed in the body not the querystring so the $http
call should be
$http({ method: 'POST', url: '/token', data: { username: $scope.username, password: $scope.password ,grant_type:password} }).success(function (data, status, headers, config) {