Search code examples
parse-serverparse-javascript-sdk

Login as a user in parse-server without having his password useing the master key?


It's possible to "simulate" a user using the master key? I would like this feature to test what the user can really see in the application and verify that he does not have access to some part of it etc.

Is this possible without knowing the password of the user?


Solution

  • You can create a Parse.Session object for the particular user, setting the user and expiresAt fields. You creating the object, get the sessionToken key from the object. Then for any request you are trying to make, you will set the X-Parse-Session-Token header to be the value of the session token.