I am attempting to build a RESTful Web API for my application. I want to know how I can use OAuth to authenticate clients. These clients will be Single Page Applications (SPAs) or thick clients. Below is how I'd like the user experience to be:
- Users access a web-application
- The landing page provides a button to login via (Facebook, Yammer, etc)
- The user logs in with the external OAuth provider
- The OAuth provider redirects him to the return URL
- The page loads and makes API calls to my web API
So couple of questions:
- What mechanisms do I use to register different clients?
- How does the SPA web application hold onto the access token issued by the OAuth provider?
- How does my web API use the access token provided to the SPA web application and identify the user's details?
P.S. I am planning to use Node.js and express with Mongoose to build the Web API.