This video shows how to generate a request token, send users to Twitter to sign in, and get authenticated users back to our application.
- [Instructor] In the previous video…we looked at a sample application called Architecture.…In this video we are going to take a look…at setting up the Express.js router…to handle the OAuth authentication flow.…We will add our Twitter keys and secrets to a config file…then we will store the state…on the client using HTTP cookies.…Finally, we will code our application…to get the request token,…send the users to Twitter,…and take the authenticated users back to our application.…Let's first look at the files that we'll be using.…
We have four files, index.js is the…entry point to our application.…It has the express.js router configuration.…Authenticator.js has the handlers…for the routes used by OAuth.…Config.json has our application's keys, URLs and ports,…and package.json has the application's metadata.…Let's open package.json.…We can see that we have three dependencies.…Cookie-parser is an Express.js…middleware for parsing cookies.…
Express is the web framework,…and OAuth is an amazing Node.js module…for communicating with OAuth servers.…
This Node.js course gives you an overview of a RESTful API and the logical steps of creating one. It explores three different APIs, focusing on their similarities and differences and how to effectively implement one. Instructor Saleh Hamadeh starts off by defining APIs, showing how they can be built on top of HTTP and listing the properties that make an API RESTful. Learn how to develop Twitter Notes, a sample web application that lets users leave notes for their Twitter friends. Use Twitter's API to implement a login flow and then design a web API. Additionally, get a closer look at several other real-world APIs, and learn some best practices to keep APIs secure, maintainable, and efficient.
- Identifying REST resources
- Setting up the development environment
- Consuming a RESTful API
- Creating an OAuth login request
- Getting an access token
- Saving data in MongoDB
- Building a RESTful API
- Testing user-perceived performance
- Looking at APIs in the real world
- Best practices for building RESTful APIs