Java 中的简单 OpenID

发布于 2024-12-17 10:28:34 字数 389 浏览 0 评论 0原文

我是 OpenID 新手。是否可以在 Java 中针对 OpenID 执行类似的操作?

String username = "user";
String password = "pass";

OpenID openID = new OpenID(username, password);

然后我检索一些东西......回调,事件......类似的东西

void opedIDAuthenticatedSuccessfully(OpenIDEvent event) {
    String id = event.getID;
    String user = event.username;
    ...
}

它会很可爱!

I'm new into OpenID. Is it possible to do something like this in Java against OpenID?

String username = "user";
String password = "pass";

OpenID openID = new OpenID(username, password);

And then I retrieve something... callback, event... something like

void opedIDAuthenticatedSuccessfully(OpenIDEvent event) {
    String id = event.getID;
    String user = event.username;
    ...
}

It would be lovely!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

二手情话 2024-12-24 10:28:34

有一个适用于 Java 的 OpenID 库:http://code.google.com/p/openid4java

此库允许您为 Java Web 应用程序启用 OpenID。

支持以下规格:

  • OpenID 身份验证 2.0
  • OpenID 身份验证 1.1(兼容模式)
  • OpenID 属性交换 1.0
  • OpenID 简单注册 1.0 和 1.1,草案 1
  • OpenID 提供商身份验证策略扩展 1.0
  • OpenID 信息卡 1.0,草案 1

There is an OpenID library for Java: http://code.google.com/p/openid4java

This library allows you to OpenID-enable your Java webapp.

The following specifications are supported:

  • OpenID Authentication 2.0
  • OpenID Authentication 1.1 (in compatibility mode)
  • OpenID Attribute Exchange 1.0
  • OpenID Simple Registration 1.0 and 1.1, draft 1
  • OpenID Provider Authentication Policy Extension 1.0
  • OpenID Information Cards 1.0, draft 1
朮生 2024-12-24 10:28:34

OpenID 背后的整个想法是,绝不允许依赖应用程序(要求身份验证的应用程序)处理用户的实际身份验证凭据,这使用户的凭据更加安全,并减少应用程序的担心。

所以,不,没有办法用 OpenID 来完成您正在寻找的事情,因为您所要求的与 OpenID 的工作方式完全相反。

The entire idea behind OpenID is that the relying application (the one asking for authentication) never is allowed to handle the user's actual authentication credentials, which keeps the user's credentials more secure and gives the application less to worry about.

So, no, there isn't a way to do what you are looking for with OpenID because what you are asking for ex exactly the opposite of how OpenID works.

情泪▽动烟 2024-12-24 10:28:34

OpenID 属性交换是一种 OpenID 服务扩展,用于在端点之间交换身份信息。提供用于检索和存储身份信息的消息。更多信息请参见 doc

OpenID Connect 1.0 作为身份验证解决方案进行销售。 身份验证和授权之间的区别

OpenID 是关于验证一个人的身份身份。如果您不知道 OAUTH、OpenID 和 OPENID 之间的区别,请参阅 很好的解释

使用 java 的库请参见 openid-specs

OpenID Attribute Exchange is an OpenID service extension for exchanging identity information between endpoints. Messages for retrieval and storage of identity information are provided. More see in doc

OpenID Connect 1.0 is marketed as an Authentication solution. Difference between Authentication and Authorization

OpenID is about verifying a person's identity. If you don't know difference between OAUTH, OpenID and OPENID see good explanation

Libraries for work with java see in openid-specs

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文