简体   繁体   English

不涉及第 3 方应用程序时需要 OAUTH2?

[英]OAUTH2 needed when no 3rd party apps are involved?

Currently I'm trying to make a server in node.js with a REST api to do CRUD calls from apps made in android & iOS.目前,我正在尝试使用 REST api 在 node.js 中创建一个服务器,以便从 android 和 iOS 中制作的应用程序中进行 CRUD 调用。

And of course I would like this REST api be as secure as possible.当然,我希望这个 REST api 尽可能安全。 Spending the last few days trying to find the best way to do this seems to be a Oauth2 server over HTTPS.最近几天试图找到最好的方法来做到这一点似乎是通过 HTTPS 的 Oauth2 服务器。

I know there is a lot of this out there but I'm not able to find any simple explanation of how this should work.我知道有很多这样的东西,但我找不到任何关于它应该如何工作的简单解释。 So please don't mark this as a duplicate question as I am actually confused about this.所以请不要将此标记为重复的问题,因为我实际上对此感到困惑。

Reading about Oauth2 the app in android/ios would need to be registered with the server.阅读有关 Oauth2 的应用程序需要在 android/ios 中注册到服务器。 Everywhere I've looked this is considered a 3rd party app, which isn't the case for me.我看过的所有地方都被认为是第 3 方应用程序,但对我而言并非如此。

Oauth2 seems to be more of a secure flow to let third party apps to my REST api if the user decides to allow it.如果用户决定允许,Oauth2 似乎更安全地让第三方应用程序访问我的 REST api。 Like any app that supports login with facebook or G+.就像任何支持使用 Facebook 或 G+ 登录的应用程序一样。

But how does the original apps do it?但是原始应用程序是如何做到的呢? Like the official apps of Facebook, Twitter and Google+?喜欢 Facebook、Twitter 和 Google+ 的官方应用程序吗?

Is it possible that they use the Oauth2 basics with access/request tookens etc but skips the whole user approval part since its not a 3rd party app.他们是否有可能将 Oauth2 基础知识用于访问/请求获取等,但跳过整个用户批准部分,因为它不是第 3 方应用程序。 Or might they be using simpler username and password in headers or by post over https?或者他们可能在标题中或通过 https 发布更简单的用户名和密码?

I'm really not sure what way to take here if I'm currently not planning to add 3rd party access to my api.如果我目前不打算将 3rd 方访问权限添加到我的 api,我真的不确定在这里采取什么方式。 What would be a good way to proceed?什么是进行的好方法?

Absolutly yes !绝对是的! it's called the two legged authentification ( it works with the users credentials stored in the database of your authorization server).它被称为two legged authentification (它与存储在授权服务器数据库中的用户凭据一起使用)。 It implies just your client app and your ressources server ) You can check some documentation here :这意味着只有您的客户端应用程序和您的资源服务器)您可以在此处查看一些文档:

http://blog.nerdbank.net/2011/06/what-is-2-legged-oauth.htmlhttp://blog.nerdbank.net/2011/06/what-is-2-legged-oauth.html

http://oauthbible.com/ http://oauthbible.com/

and the official spec ( on page 10 you can see the workflow I use for my app ) : https://tools.ietf.org/html/rfc6749#section-1.3和官方规范(在第 10 页你可以看到我用于我的应用程序的工作流程): https : //tools.ietf.org/html/rfc6749#section-1.3

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM