Skip to content

How to use master key in .Net (not on cloud code, needed on local code) #3702

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
saikiran644 opened this issue Apr 10, 2017 · 5 comments
Closed

Comments

@saikiran644
Copy link

I'm trying on some code where the data should be fetched irrespective of ACL (like using a master key). But I couldn't find it in .Net (where to include). Please help with the issue.

@natanrolnik
Copy link
Contributor

natanrolnik commented Apr 10, 2017

The best is to create a Cloud function, and call your function from the .Net client. Inside that function, you set {useMasterKey: true} as the options for the query.
Master keys should never be used in clients.

@saikiran644
Copy link
Author

@natanrolnik Thank you so much for the reply. 👍
But I don't want to do it in a cloud function (I don't want to use limited cloud jobs for this) , instead from the local code itself. Is there any such option to do it that way?

@flovilmart
Copy link
Contributor

We don't allow masterKeys in the clients for security reasons, as any user would have full control over you parse deployment

@natanrolnik
Copy link
Contributor

@saikiran644 you don't need a Cloud Jobs for this. A simple Parse.Cloud.define("YourFunction", function(req, res) {} with the correct code inside will be enough. Only perform the query from the cloud function in JS, instead of doing it in .Net. And Cloud Jobs or Functions are not limited in any way.

@saikiran644
Copy link
Author

Thank You @natanrolnik & @flovilmart 👍

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

3 participants