I’m planning on doing a uniform JSON REST API for both my javascript based web app and as an API for other developers to use.
What I would like to do, is have my js app authenticate users using a username/password and allow them to access their own private resources. When the API is going to be accessed by other dev’s, I’d like to allow them to access public resources (while still being able to track their API usage) and also let them access user’s private data with the users permission (authorization ?).
Now, how would I go building such an API? What libraries/protocols/… would be the best at this?
Thanks.
You should really check out Oauth. Take a look at http://oauth.net