Skip to content

invalid session token on Parse.Config.get() #3371

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
RichieTorres opened this issue Jan 13, 2017 · 3 comments
Closed

invalid session token on Parse.Config.get() #3371

RichieTorres opened this issue Jan 13, 2017 · 3 comments

Comments

@RichieTorres
Copy link

Sometimes I got HTTP 400 and { code: 209, message: 'invalid session token' } when try to get Parse.Config [Parse.Config.get().then(...)] in Cloud Code

I should use master key for get Parse.Config on Cloud Code ?

Environment Setup

  • Server
    • parse-server version 2.2.25
    • Localhost or remote server? AWS

Logs/Trace

From ngnix access log

[13/Jan/2017:20:39:50 +0000] "POST /parse/config HTTP/1.1" 400 44 "-" "node-XMLHttpRequest, Parse/js1.9.2 (NodeJS 6.3.1)" "-"

@natanrolnik
Copy link
Contributor

@AndresRicardoTorres How did you initialize your server - with client and javascript keys, or only application id and master key? And how are you initializing the Parse client?

The master key is not needed to get the Config, only to update it.

@natanrolnik
Copy link
Contributor

Closing this issue. Make sure you setup the keys correctly in the SDK initialization.

If you have any updates about why it's not working, and we verify it's a bug in Parse Server, we'll reopen.

@RichieTorres
Copy link
Author

Server is configured with APP_ID and Master Key:

      appId: options.APP_ID,
      masterKey: options.MASTER_KEY

Client is initialize with (Android):

Parse.initialize(new Parse.Configuration.Builder(mContext)
               .applicationId(BuildConfig.PARSE_APP_ID)
               .clientKey("dummyClientID")
               .server(getString(R.string.SERVER_URL))
               .enableLocalDataStore()
               .build()
       );

The issue happens when a cloud is executed and hits the first server, inside the cloud code, we have
Parse.Config.get().then(...), this call hits the other server and returns HTTP 400.

Our environment runs the parse app in two different EC2 instances behind an Elastic load balancer and the database in other instances. Do we have to configure a cache adapter on this environment ?

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