Java 的 OpenID 架构
我试图了解在您的项目中实施 OpenID 的概念和好处。而且,由于我是一名 Java 开发人员,因此我或多或少对了解其主要 Java 实现 openid4java
感兴趣。
我的理解是,OpenID 是一个以统一方式提供去中心化 ID 的标准。现在,如果这是完全(或稍微)不正确的,请纠正我!
假设我仍在正轨上,我发现各种类型或组织都在使用 OpenID,例如 MySpace,它使用与 http://www.myspace.com/username.
那么 OpenID 作为一个系统是如何工作的呢?它是否只是将自己表现为一个“OpenID 服务器”网络,就像 DNS 机器一样,协调并确保系统中的所有 ID 都是唯一的并匹配某种模式?或者,它只是一种算法,像 GUID 一样,为每个客户端域(例如 MySpace)生成全局唯一的 ID。
我只是不明白 OpenID 实际上是如何表现出来的,以及像 openid4java 这样的框架如何与这种“表现”发生反应。 (它们的用途是什么)。
I'm trying to understand the concept and benefits of implementing OpenID in your project. And, since I'm a Java developer, I'm more or less equally interested in understanding its main Java implementation, openid4java
.
My understanding is that OpenID is a standard for provisioning decentralized IDs in a uniform way. Now, if that is totally (or even slightly) incorrect, please correct me!
Assuming I'm still on track, I see that all sorts or organizations have been using OpenID, such as MySpace, who identifies each of their users with a URL matching http://www.myspace.com/username
.
So how does OpenID work as a system? Does it just manifest itself as a network of "OpenID Servers" that, like DNS machines, coordinate and make sure all IDs in their system are unique and match a certain pattern? Or, is it just an algorithm to be used which, like GUID
, produces globally-unique IDs for each client domain (such as MySpace).
I'm just not understanding how OpenID actually manifests itself, and how frameworks like openid4java ineract with that "manifestation". (What their uses are).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先,OpenID 通信有两个方面:提供者和消费者。消费者是尝试使用 OpenID 进行身份验证的应用程序,而提供者是向其发送身份验证请求的服务器。
每个提供商都有一个所谓的端点 - 接受身份验证请求的 url。在支持 OpenID 提供商时,您应该提前知道该 URL。首先,您必须发现给定 openId 的端点是什么,然后与该提供者交换消息。这一切都包含在 openid4java
ConsumerManager
中。然后进行身份验证 - 您将用户重定向到提供商 url,用户确认他想要使用他的帐户登录(应该登录),然后提供商重定向回您,然后您可以获得有关所请求的信息用户(通过另一个请求)
First, there are two sides of the OpenID communication - the provider and the consumer. The consumer is the application that tries to authenticate using OpenID, and the provider is the server to which the authentication request is sent.
Each provider has a so-called Endpoint - url that accepts authentication requests. You should know that URL in advance when supporting an OpenID provider. First you have to discover what is the endpoint for a given openId, and then exchange messages with that provider. This is all wrapped in openid4java
ConsumerManager
.Then happens the authentication - you redirect the user to a provider url, where the user confirms he wants to login using his account (should be logged in), then the provider redirects back to you, and then you can get the requested information about the user (through another request)