Вопрос

It's now trivial to create a web app that sits atop Parse.com. Now that I have this webapp, I want to expose parts of it to other developers via an oauth accesible api. So, they can develop an app that lets my site users 'give them permission' via oauth and they can now access the api.

How would I start going about doing this?

Update: After @Mubix response, I felt the following clarification would help

Currently I am accessing Parse from the server via a REST api, to get around any javascript security issues re:api keys etc. So, the api would be served of a server other than Parse. Also, the server code is in javascript / nodejs. I came across https://github.com/jaredhanson/oauth2orize which seems a likely candidate, was wondering how others are doing it and if anyone has actually gone a further step and integrated Parse access.

Это было полезно?

Решение

Hmmm .. Intereesting question!

Legal: First of all their ToS doesn't seem to prohibit what you are trying to do but you should read it carefully before you start.

Implementation: While parse doesn't provide feature to build your own APIs you could implement something yourself. You could treat the third party developers as users of your app. And you can use the ACL to control access.

Problems:

  • I don't see any way to implement oAuth entirely within parse.
  • How will third party apps access your API? Ideally you would like them to use a REST interface but with the parse.com REST API you won't be able to manage access to different parts of your data.

Conclusion: It seems like too much trouble to implement the API entirely within parse. I would suggest that you write a thin API layer that takes care of auth and uses parse as the backend. You can use one of the service side libraries available for parse. eg. PHP Library, Node Parse.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top