Skip to content

Master Read Only Key Not Working #839

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
danielchangsoojones opened this issue Feb 16, 2018 · 9 comments
Closed

Master Read Only Key Not Working #839

danielchangsoojones opened this issue Feb 16, 2018 · 9 comments
Labels
state:wont-fix Won’t be fixed with a clearly stated reason

Comments

@danielchangsoojones
Copy link

danielchangsoojones commented Feb 16, 2018

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

  • [x ] You're running version >=1.0.23 of Parse Dashboard.

  • [x ] You're running version >=2.3.2 of Parse Server.

  • [ x] You've searched through existing issues. Chances are that your issue has been reported or resolved before.

Environment Setup

Steps to reproduce

Logs/Trace

Note: If you get a browser JS error please run npm run dev. This will provide source maps and a much more useful stack trace.

Read Only Master Key does not work with the newest Parse Server version. I tried setting up a read only Parse Dashboard with a Read Only Master Key. However, it continually would give me the error that I needed a Master Key to be authorized, even though I was passing the Master Key and the Read Only Master Key. I then changed my actual Parse Server's project version to "parse-server": "~2.7.2" in the dependencies of the package.json file. Then, when I ran the Parse Dashboard again, it finally worked. So, the Parse Server was the actual problem when using Read Only Master Keys. I hope this gets fixed one day, but for now I will just stay on the 2.7.2 version of Parse Server for read only keys.

@flovilmart
Copy link
Contributor

Can you provide you double check your server configuration please?

@flovilmart
Copy link
Contributor

@danielchangsoojones in order to have a properly functional read only setup in the dashboard you need.

Parse Dashboard Config:

{
  "apps": [
    {
      "serverURL": "https://my-parse.com/1",
      "appId": "APP_ID",
      "javascriptKey": "JS_KEY",
      "restKey": "REST_KEY",
      "masterKey": "MASTER_KEY",
      "readOnlyMasterKey": "READ_ONLY_MASTER_KEY",
      "appName": "My Parse App",
      "supportedPushLocales": []
    }],
   {
      "user":"readonly",
      "pass": ".....",
      "readOnly": true,
      "apps": [{"appId": "APP_ID"}]
    }
}

Then on parse-server:

{
   "applicationId": "APP_ID",
   "masterKey": "MASTER_KEY",
   "readOnlyMasterKey": "READ_ONLY_MASTER_KEY"
    ...
}
``` 

Can you double check this is the case?

@adolfdsilva
Copy link

Getting same issue...
Below is my parse-server-example .js snippet...


var api = new ParseServer({
  databaseURI: databaseUri || 'mongodb://localhost:27017/dev',
  cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js',
  appId: process.env.APP_ID || '1',
  masterKey: process.env.MASTER_KEY || 'QkRBFtZmfYdloLznf***', //Add your master key here. Keep it secret!
  readOnlyMasterKey: process.env.READ_ONLY_MASTER_KEY || 'lbcyGdlBgJ***',
  serverURL: process.env.SERVER_URL || 'http://192.168.17.32:1337/mpwt',  // Don't forget to change to https if needed
  liveQuery: {
    classNames: ["Posts", "Comments"] // List of classes to support for query subscriptions
  }

Dashboard config:


{
  "apps": [
    {
      "serverURL": "http://192.168.17.32:1337/mpwt",
      "appId": "1",
      "masterKey": "QkRBFtZmfYd***",
      "readOnlyMasterKey":"lbcyGdl***,
      "appName": "MPWT",
      "primaryBackgroundColor": "#215e97",
      "secondaryBackgroundColor": "#286CB5"
    },
    {
      "serverURL": "http://192.168.17.32:1338/dragon",
      "appId": "2",
      "masterKey": "QkRBFtZmfYd***",
      "readOnlyMasterKey":"lbcyGdl***",
      "appName": "Dragon",
      "primaryBackgroundColor": "#D50000", 
      "secondaryBackgroundColor": "#286CB5"
    }
  ],
  "users": [
    {
      "user":"admin",
      "pass":"$2y$10$DsLAb8SlV2dhgGpJ0ApRnu3W9oDL9t5TDLlMCsEfua2.DOOI8TKTS",
      "apps": [{"appId": "1"}, {"appId": "2"}]
    },
    { 
      "user":"test",
      "readOnly":true,
      "pass":"$2y$10$I/G0oy.n4XY6TAtfxTF0y.UyMOk.Bw4veHUIow4iUycVp80Z9qtKS",
      "apps": [{"appId": "1"}, {"appId": "2"}]
    }
  ],
  "useEncryptedPasswords": true
}

@flovilmart
Copy link
Contributor

flovilmart commented Apr 19, 2018

@adolfdsilva what version of the dashboard and the server are you running?

@adolfdsilva
Copy link

adolfdsilva commented Apr 20, 2018

hi parse-server 2.7.4 and parser dashboard 1.2.0... And I'm using parse-server-example for running parse server

screen shot 2018-04-20 at 4 08 29 pm

screen shot 2018-04-20 at 4 07 29 pm

@adolfdsilva
Copy link

Hey @flovilmart can you please help...I'm still stuck here :(

@flovilmart
Copy link
Contributor

Can you provide a screenshot of the dashboard at the app selector page?

Also, can you provide the screenshots of the errors you see?

I find it curious as we’re running it in production without any issue.

@adolfdsilva
Copy link

adolfdsilva commented Apr 25, 2018

screen shot 2018-04-25 at 10 54 35 am

screen shot 2018-04-25 at 11 00 08 am

I have created 2 users "admin" and "test". Test has readOnly for MPWT App.
The logs screenshot I've taken with admin login.

@stale
Copy link

stale bot commented Jan 10, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the state:wont-fix Won’t be fixed with a clearly stated reason label Jan 10, 2019
@stale stale bot closed this as completed Jan 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state:wont-fix Won’t be fixed with a clearly stated reason
Projects
None yet
Development

No branches or pull requests

3 participants