我需要Oauth2对于我的Web Apps API [英] Do I need Oauth2 For my Web Apps API

查看:172
本文介绍了我需要Oauth2对于我的Web Apps API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在围绕构建基于express.js / node.js的REST API来围绕我的大脑。我有几个问题...

I am trying to wrap my brain around building an express.js / node.js based REST API. I have a couple of questions...


  1. 我需要基于令牌的/ oauth 1或2安全性为我的api如果我现在只关心一个网络应用程序(不一定是手机应用程序)

  1. Do I NEED token based / oauth 1 or 2 security for my api if I'm only concerned about a web application right now (not necessarily phone apps)

有没有资源学习如何从头开始构建?我已经阅读了前3页的谷歌搜索休息api与oauth2认证express.js,我还没有抓住它。

Are there any resources to learn how to build this from scratch? I've read literally the first 3 pages of googling "rest api with oauth2 authentication express.js" and i'm still not grasping it.


推荐答案

您希望在节点中执行REST API的好处。它非常适合构建基于API的请求。

Its good that you want to do a REST API in node. Its really good in building API based request.

对于您的问题:

1)如果您正在构建一个基本的API,具有简单的GET和POST请求,那么您可能想问问自己是否显示或操作的数据需要安全性。如果不是,那么很可能你不需要实现OAuth。

1) If you are building just a basic API, with simple GET and POST requests, then you might want to ask yourself if the data that you are displaying or manipulating requires "security". If not then most likely, you don't need to implement OAuth.

但是,如果您的数据敏感,例如私人用户数据,则需要在API上放置一些安全层。此外,使用OAuth或其他基于令牌的安全性可以帮助您在您的用户群中构建更好的权限检查。

But if your data is sensitive, such as private user data, then you need to put some sort of security layer on your API. Also, using OAuth or other token based security can help you build a better permission checking across your user base.

2)您首先需要掌握OAuth的概念。一旦了解了OAuth的工作原理,那么它真的很容易在您选择的语言中实现。
这里有一些关于如何理解OAuth更好的阅读方式。

2) You first need to grasp the concept of OAuth. Once you have the idea of how OAuth works, then its really easy to implement in your chosen language. Here are some good reads on how you can understand OAuth better

http://www.slideshare.net/MindfireSolutions/oauth-and-休息?qid = 09a7d224-78bb-4b47-8957-3f0a0ce809a4& v = qf1& b =& from_search = 3

有关OAuth的更多详细信息: http://tools.ietf.org/html/rfc6749

For more detailed info about OAuth: http://tools.ietf.org/html/rfc6749

再次,一旦您了解OAuth的工作流程,您可以轻松实现。 :P

Again, once you understand the workflow of OAuth, you can implement it easily. :P

这篇关于我需要Oauth2对于我的Web Apps API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆