0

We have an existing user database with SHA1-encoded passwords. We upload them to the Google Federated Database (through the GitKitClient java lib), but then these uploaded users can't log in The verifyPassword always returns "Incorrect password" ! The call to the uploadUsers looks like gitkitClient.uploadUsers('SHA1', new byte[0], gitkitUsers) (We must provide an empty byte array as second param (hash key), since we get NPEs if we provide a null value)

The method that creates the GitkitUsers that are in the list is as follows:

private GitkitUser createGitkitUserFromUser(User user) {
    GitkitUser gitkitUser = new GitkitUser()
    gitkitUser.email = user.email
    gitkitUser.localId = getLocalId(user)
    gitkitUser.name = user.displayName
    gitkitUser.hash = user.password?.bytes
    if (user.pictureFileName) {
        gitkitUser.photoUrl = user.getPictureUrl()
    }
    return gitkitUser
}

We see no way to further investigate. Did someone successfully use it ?

SurfinJim
  • 51
  • 4

1 Answers1

0

Make sure that the hashKey you use in setPassword() is the same one used in uploadUsers().

I am using the php SDK so I can't share code for you, but when I did NOT use the same hashKey for both places, I had the same problem.

George Bittmann
  • 143
  • 2
  • 11
  • This is really a comment, not an answer. With a bit more rep, [you will be able to post comments](//stackoverflow.com/privileges/comment). – Enamul Hassan Jul 27 '16 at 17:03