Login as a user without their PW?

Is there a way I can have my customer service team login as a user without their password? Is that what the set current user block does? And if it is, what input do I send it, Users.email, Users.objectId?

Thanks,
Tim

Do you need them to log in into your app or perform a login in Backendless Console to impersonate the user when making API calls?

Log in to the app.

It is possible. Here’s a high-level overview of the approach:

  1. Customer support should have a separate login page - you need to make sure it is someone with a permission to impersonate another user.
  2. Once they are logged in, they need to identify the user they want to impersonate. Suppose that user is identified with an email address
  3. Make an API service call where you send the email address from (2). The API service will be responsible for logging in the selected user and returning user-token and the user object back to the client. To login the user, it needs to lookup user’s objectId and login the user with the following block (the block is available only in Cloud Code):
    Codeless - BL - ConsoleDemo - Backendless 2022-09-15 14-11-50
  4. The UI gets the user token and sets it with the “Set user token” block. It does the same with the user object.
    Codeless - BL - ConsoleDemo - Backendless 2022-09-15 14-12-58
    I recommend setting the “Stay logged in” argument to false.
    Codeless - BL - ConsoleDemo - Backendless 2022-09-15 14-13-21
  5. At this point the client app is logged in as the selected user.

Hope this helps.
Mark

This is exactly what I needed. Thank you!