Skip to content

How to access Require revocable sessions and other app settings? #244

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

Closed
r2DoesInc opened this issue Apr 9, 2016 · 7 comments
Closed

How to access Require revocable sessions and other app settings? #244

r2DoesInc opened this issue Apr 9, 2016 · 7 comments

Comments

@r2DoesInc
Copy link

Make sure these boxes are checked before submitting your issue -- thanks for reporting issues back to Parse Dashboard!

  • [ x] You're running version >=2.1.4 of Parse Server.
  • [ x] You've searched through existing issues. Chances are that your issue has been reported or resolved before.

Environment Setup

parse dash and server on docker.

I need to get a sessionToken from a ParseUser object.Per the answer here http://stackoverflow.com/questions/33492263/how-to-create-a-parse-user-account-from-a-android-google-token/33631230 I need to turn off revokable sessions via the app settings interface. This is available via the parse.com dashboard, and is fone for apps that I migrated from parse.com to parse server, but for the new app I am making, the parse.com dashboard doesnt have a listing.

How do I get to the app and other settings for a project that was never on parse.com?

@drew-gross
Copy link
Contributor

This depends on the setting. Non-revocable sessions are not available in Parse Server. Some other settings are controlled through the Parse Server initialization code. You can check the Parse Server README and docs for more info.

@r2DoesInc
Copy link
Author

The specific one I need is the revocable settings as that SO question outlines. I need to retrieve the sessionToken from my Parse User and currently it just returns null due to the revocable sessions setting.

@r2DoesInc
Copy link
Author

Bit convoluted, but for anyone who ends up here after the same search, to get the token for a user you need to

  • login with g+ on phone
  • get token via GoogleAuthUtil.getToken()
  • send token to parse cloud
  • verify token azp, aud, and email against https://www.googleapis.com/oauth2/v3/tokeninfo?access_token=
  • Search for the user with the matching email.
  • Search for sessions q.equalTo("user", user);
  • Send back the sessionToken from the Session object you found.

@drew-gross
Copy link
Contributor

Revocable sessions aren't part of Parse Server. Unfortunately you will need to use a different strategy than the one presented in that SO question.

@r2DoesInc
Copy link
Author

Gotcha. Was able to get it using that question as a starting point. I just had to manually query the sessions and find the correct one.

@drew-gross
Copy link
Contributor

That makes sense. You should consider posting an answer to that Stack Overflow and contributing back to the community!

@r2DoesInc
Copy link
Author

Affter i get all the examples together im going to put together some sort of blog post and put it up there for sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants