Why can not login if we insert the record manually into real Online Google Datastore, but can if we insert record via our system?

44 views
Skip to first unread message

Hung Ha

unread,
Jan 17, 2016, 6:30:43 AM1/17/16
to Google App Engine

Ok, I got a small app, when registering a new acc, a user have to provide

UserName
Name
Password

If I register a new user via our system (Ex: Tom12, Tom, 123456), then I can login with userNameTom12 & password: 123456.

Now, login online Google Datastore & manually insert this record into it: Ex: Tom13, Tom, 654321

But this time I can not login with user Name Tom13 & password 654321.

So my question is that,

does Google Datastore add some timestamps or something like that into the system that I can not log in?

Hung Ha

unread,
Jan 17, 2016, 8:23:31 AM1/17/16
to Google App Engine

You can see the getUser function. Note that, the userNameis also the Key Name

public static User getUser(String userName){
    Key k = KeyFactory.createKey(personKey, "User", userName);
    try {
        Entity userEntity=datastore.get(k);
        //Entity userEntity=datastore.get(userName,personKey);
        if(userEntity!=null){
            User user=new User(userName);


            setUserFromUserEntity(user, userEntity);
            return user;
        }
    } catch (EntityNotFoundException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    return null;
}

Chad Vincent

unread,
Jan 18, 2016, 12:20:47 PM1/18/16
to Google App Engine
Where is it failing?  Is it failing to load the user, or failing to validate the password?

Is it possible your hash+salt for the password isn't getting set properly when you set via console?  (Is it deriving the salt from the app ID or namespace somehow?)
Reply all
Reply to author
Forward
0 new messages