Backendless Support
 
Answered

Login in Programmatically

Hi,

I want to update user information, but cannot log in. I have consulted the [Documentation].

I get a handleFault response callback saying invalid username and password. I do know i have the correct username,

but I do not have the right password. How do I get the correct password from backendless so that I can log in and update the user's information.

Regards

Rhonwen

Leave a Comment

Comments (2)

photo
1

I see that you cannot get the password for security reasons. How do I programmatically change the user's password so that I can log in to update the user's information?

photo
1

Hi I found a way to achieve my goal. Thank you anyway. See code below:

  1. DataQueryBuilder builder = DataQueryBuilder.create();
  2. builder.setWhereClause("email = '"+list.get(position).getEmail()+ "'");
  3. Backendless.Persistence.of(BackendlessUser.class).find(builder, new AsyncCallback<List<BackendlessUser>>() {
  4. @Override
  5. public void handleResponse(List<BackendlessUser> response)
  6. {
  7. if(accepted.isChecked()) {
  8. response.get(0).setProperty("accepted", "TRUE");
  9. Backendless.UserService.update(response.get(0), new AsyncCallback<BackendlessUser>() {
  10. @Override
  11. public void handleResponse(BackendlessUser response) {
  12. Toast.makeText(context, "User updated", Toast.LENGTH_LONG).show();
  13. }
  14. @Override
  15. public void handleFault(BackendlessFault fault) {
  16. }
  17. });
  18. }
  19. else
  20. {
  21. response.get(0).setProperty("accepted", "FALSE");
  22. Backendless.UserService.update(response.get(0), new AsyncCallback<BackendlessUser>() {
  23. @Override
  24. public void handleResponse(BackendlessUser response) {
  25. Toast.makeText(context, "User updated", Toast.LENGTH_LONG).show();
  26. }
  27. @Override
  28. public void handleFault(BackendlessFault fault) {
  29. }
  30. });
  31. }
  32. }
  33. @Override
  34. public void handleFault(BackendlessFault fault) {
  35. }
  36. });