Skip to content

400 bad request on invalid login #3

danieleli opened this Issue Aug 27, 2012 · 1 comment

2 participants


type a random username and password and hit login returns 400 from clean clone of repo.

but if you open the url directly you get a nice error code.

for example this url.

returns this:

"error": "invalid_grant",
"error_description": "invalid username or password"

Simple fix is on line 1358 of sdk check response.error === undefined or something like that. code below.

function logInAppUser (username, password, successCallback, failureCallback) {
var self = this;
var data = {"username": username, "password": password, "grant_type": "password"};
this.runAppQuery(new Usergrid.Query('GET', 'token', null, data,
function (response) {
!!!!!! check response.error here !!!!!!
var user = new Usergrid.Entity('users');
user.set('username', response.user.username);
user.set('uuid', response.user.uuid);
if (successCallback && typeof(successCallback) == "function") {
function (response) {
if (failureCallback && typeof(failureCallback) == "function") {

Apigee member
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.