了解OAuth 2.0中客户端ID和客户端密码的需求

编程入门 行业动态 更新时间:2024-10-17 15:26:46
本文介绍了了解OAuth 2.0中客户端ID和客户端密码的需求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个网站,要求用户通过提供其电子邮件和密码以获取访问令牌来登录,其中访问令牌用于访问api。

I have a web site that requires user to log in by providing their email and password to gain access token, where the access token token is used to access api.

然后,用户可以使用访问令牌提供的范围来获得对读/写的访问权限。

User can then gain access to read/write with the scope provided by the access token.

因此,我在这里想了解的是客户端id扮演什么角色和客户机密在这种情况下发挥作用,实施客户ID和客户机密可以带来什么好处?因为我真的没有实现客户端ID和客户端机密的需要,因为用户可能只是使用访问令牌来获取访问权限。

So, what I would like to understand here is that what roles does client id and client secret play in such a case, and what benefits can implement client id and client secret provide? Because i really do not see the need of implementing client id and client secret since user may just use access token to gain access right.

推荐答案

如果没有它们就可以实现想要的功能,则不必颁发客户端ID。例如,如果您具有直接处理电子邮件(用户ID)和密码的特权,则不需要客户端ID。

You don't have to issue client IDs if you can achieve what you want to do without them. For example, if you have privileges to handle email (user ID) and password directly, you don't need a client ID.

通常,仅需要客户端ID当您想允许(第三方)客户端应用程序使用受限特权访问(您的服务的)用户数据时。在这种情况下,每个客户端应用程序都必须由用户授予授权。结果,您的系统将需要客户端ID才能知道用户已授予其权限的客户端应用程序。

In general, client IDs are needed only when you want to allow (third-party) client applications to access (your service's) users' data with restricted privileges. In this case, each client application must be given authorization by a user. As a result, your system will need client IDs to know which client application the user has granted permissions to.

更多推荐

了解OAuth 2.0中客户端ID和客户端密码的需求

本文发布于:2023-11-07 15:21:43,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1566807.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:客户端   需求   密码   OAuth   ID

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!