concept OAuth2 in category cors

appears as: OAuth2
CORS in Action: Creating and consuming cross-origin APIs

This is an excerpt from Manning's book CORS in Action: Creating and consuming cross-origin APIs.

  • Use something other than a cookie to validate the user. If you’re building a public API, or need to provide authorized access to all origins, an authorization mechanism like OAuth2 might be a better fit for your needs.
  • The next section explores the last bullet point in-depth by looking at what OAuth2 is and how it works.

    So if you can’t share your password, how can the startup app gain access to your data? OAuth2 can save the day. OAuth2 is an open authorization standard. It’s a popular authorization mechanism for APIs. APIs from Dropbox, Facebook, GitHub, and Google (to name a few) all use OAuth2. The goal of OAuth2 is to allow a site to get user data from a different site without asking for the user’s password. This keeps the user’s password safe, and puts the user in control of when and how his or her data is used.