Brandogs
Brandogs

Reputation: 155

Parse REST API Key breaks Client Key Authentication

I am currently working on an iOS app that interacts with Parse, which we are currently hosting on AWS.

PFUser.logInWithUsername(inBackground: email.lowercased(), password: password)

I was asked to create a Rest API Key that will be used by our web developer who is creating a web app that will also access said Parse instance. The Rest API Key was added to the Parse initialization.

restAPIKey: process.env.REST_KEY || ''

Rest Services seem to be working fine with this addition. However, the iOS application is less than please with this change, returning the following when attempting to authenticate.

[Error]: unauthorized (Code: 0, Version: 1.14.2)

Is there a way to get around this issue for the application without involving the Rest Key in the client applications? Probably some additional handling in the cloud code?

I'd rather avoid using the Rest Key in the client apps if possible.

Upvotes: 0

Views: 266

Answers (1)

Naresh
Naresh

Reputation: 344

Maybe your issue is realted to this Github thread

https://github.com/ParsePlatform/parse-server/issues/1230

The conclusion in the thread is that, you need to set the clientKey on the server side. That will solve the issue and no need to send/set the clientKey from the client side.

Upvotes: 0

Related Questions