-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getSessionToken() returning undefined #2052
Comments
To help us debug this, can you include the exact request and response in Parse Server? (you can see this in the logs using |
added |
Ah, you need to do a "signup" or "login" action to create a session token. Simply modifying a user will not create a session token. You can also query the |
I'm not doing a "signup" or "login" in the I was under the impression (from the docs) that the Ideally I'd like to set a random, strong password on each user and forget about it since the SSO is handling authentication - but if I'm reading correctly, that's not possible. I need the password to login to generate the session. |
In cloud code, with the master key, you can do anything you want. Query the session table directly, create sessions directly, etc. you could even set a new password for the user on every request, then use that new password to log in. Client code (read: any code not using the master key) does require a login/signup to create sessions. |
Describe your issue in as much detail as possible.
I'm setting up a SAML SSO.
Using the JS SDK, I get a token and then query for existing users or create a new one.
In both instances I call
user.getSessionToken()
on the user object.Getting the user from a query results in an undefined sessionToken.
Saving the new user and calling the function returns a valid sessionToken.
Expected Results
I expect to get a valid sessionToken in both instances.
Environment Setup
"parse-server": "^2.2.7",
Logs/Trace
The text was updated successfully, but these errors were encountered: