前几日学习了一下OAuth 2.0,那么就不得不再了解一下OpenID了。因为它们经常是一块儿使用的。
首先OpenID是什么?
借用百度百科的解释,OpenID 是一个以用户为中心的数字身份识别框架,它具有开放、分散性。OpenID 的创建基于这样一个概念:我们可以通过 URI (又叫 URL 或网站地址)来认证一个网站的唯一身份,同理,我们也可以通过这种方式来作为用户的身份认证。
简单点讲,OpenID是一个通用的账号,这个账号是由一个提供者管理维护,可以被多个网站共同使用。同时,这个账号提供者也为这些网站提供该账号的身份认证,而这些网站也仅能得到该账号的已授权开放的信息。
原文: OpenID allows you to use an existing account to sign in to multiple websites, without needing to create new passwords.
You may choose to associate information with your OpenID that can be shared with the websites you visit, such as a name or email address. With OpenID, you control how much of that information is shared with the websites you visit.
With OpenID, your password is only given to your identity provider, and that provider then confirms your identity to the websites you visit. Other than your provider, no website ever sees your password, so you don’t need to worry about an unscrupulous or insecure website compromising your identity.
OpenID最初是由一个开源社区在2015年夏天,为了解决(当时)现有技术无法轻易实现的身份识别而自己创建的。OpenID是分散的(decentralized ),不属于任何人,也不应该属于任何人。今天,任何人都可以选择使用OpenID或免费成为OpenID提供者,而无需注册或获得任何组织的批准。像我们今天所熟知的Google, Yahoo, Facebook, Github,腾讯等,都是OpenID提供者。我们都可以使用这些系统中的账号登录一些第三方系统。
OpenID 和 OAuth 的区别
OpenID侧重的是authentication,而OAuth关注的是authorization。从表面上看,这两个英文单词很容易混淆,但实际上,它们的含义有本质的区别:
authentication
: n. 证明;鉴定;证实。
authorization
: n. 授权,认可;批准,委任。
OpenID关注的是认证,即:“用户是谁”。而OAuth关注的是授权,即:“用户能做什么”。
[参考]
官网:https://openid.net
OpenID Connect Core 1.0: https://openid.net/specs/openid-connect-core-1_0.html
OpenID百度百科:https://baike.baidu.com/item/OpenID/2267230?fr=aladdin
OpenID及其原理介绍,OAuth和OpenID的区别:https://blog.csdn.net/xcjing/article/details/73826889