Skip to content
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

Setting Rest and Client key on server breaks iOS app #3683

Closed
bendigi opened this issue Apr 1, 2017 · 2 comments
Closed

Setting Rest and Client key on server breaks iOS app #3683

bendigi opened this issue Apr 1, 2017 · 2 comments

Comments

@bendigi
Copy link

bendigi commented Apr 1, 2017

Issue Description

The issue is quite simple to explain and even easier to reproduce.

We have

  1. Parse Server with app id and master key
  2. iOS with app id and client key
  3. JavaScript with app id, rest key and master key

As far as we know the rest key and client key are ignored by the server because they are not set.

What we want to do

Enable rest key and client key on the server side, to force the server to authenticate the rest key.

Once it is enforced by the server, we then want to change the rest key in order de-authorize Javascript access from outside of the organization. Basically, anyone that has the old rest key won't be able to query with just the app id and master key

The problem

iOS stops working (authorization) even though it has the correct client key.

Steps to reproduce

Simply setup Parse with client key and rest key

Expected Results

iOS with client key to authenticate

Actual Outcome

iOS fails to authenticate

Environment Setup

  • Server
    • parse-server version (Be specific! Don't say 'latest'.) : 2.3.1
    • Operating System: Ubuntu 16.04 LTS
    • Hardware: 1 vCPU, 3.75 GB memory
    • Localhost or remote server? (AWS, Heroku, Azure, Digital Ocean, etc): GCE

Logs/Trace

Standard authentication error on iOS

@bendigi bendigi changed the title Setting Rest API and Client API key on the server breaks iOS app Setting Rest and Client key on server breaks iOS app Apr 1, 2017
@steven-supersolid
Copy link
Contributor

Can you post an example of your parse-server constructor when it is working and not working?

If you specify any key in parse-server then that key is checked if present in the request from the client and other keys not specified will be invalid. E.g. if you specify only REST in parse-server then client key will no longer work. If you want to change your REST key then you must supply the new REST key and the old client key to the constructor.

Probably it is the above but posting your constructor will help assess the problem.

@bendigi
Copy link
Author

bendigi commented Apr 4, 2017

How embarrassing .....

I wrote my response, formatted all the code snippets, removed all the keys and replaced them with random numbers and then I saw it.

WE SPELLED clientKey wrong, like cientKey and I only noticed it once the spell checker underlined it with red.

I will try this again and if necessary re-open.

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