与J2EE用户认证 [英] User authentication with J2EE

查看:118
本文介绍了与J2EE用户认证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的网站,我让我的用户使用其名称和密码(此数据存储在我的数据库)登录。但现在我希望让他们通过使用他们的社交网络账号,如Facebook,Gmail的登录...
我的网站是一个JBOSS应用服务器上运行。而用户的认证是由一个基于表单的认证完成,有点像这个例子中的http://dont-panic.eu/blogs/2012/sep/form-based-authentication-against-custom-database-jboss-7.
是否有可能加入这个新功能(与社交网络帐号登录),并维持老一(简单的登录)无我目前正在做的用户认证方式大的变化?如果是的话,我该怎么办呢?

in my website I'm allowing my users to login using their name and their password (this data is stored in my database). But now I want to allow them to login by using their social networks account, like facebook, gmail... My website is running on a JBOSS application server. And the users authentication is done by a form-based authentication, kinda like this example http://dont-panic.eu/blogs/2012/sep/form-based-authentication-against-custom-database-jboss-7. Is it possible to add this new functionality (login with social networks account) and maintaining the older one (simple login) without big changes in the way I'm currently doing the user authentication? If yes, how can I do it?

非常感谢!

推荐答案

我很抱歉,但我认为有没有简单的方法来完成它。问题是,你需要实现自定义的 JAAS 提供商采用的 OAuth认证。该OAuth是简单的,你可以看到我的样品code链接的项目。但是JAAS更难。我曾经在几年前尝试过了,我就放弃了。

I am sorry but I think that there is no easy way to accomplish it. The problem is that you would need to implement your custom JAAS provider that utilizes OAuth authentication. The OAuth is simple, you can see my linked project for sample code. But JAAS is much harder. I tried it once several years ago and I gave up.

您可以执行一些code认证(像我一样),但没有与JAAS集成你不能使用标准的功能,如<安全约束>

You can implement some code for authentication (like I did) but without integration with JAAS you cannot use standard features like <security-constraint>.

其它一些有用的链接:


  1. http://docs.oracle.com/javase/7/docs/technotes/guides/security/jaas/JAASRefGuide.html

  2. http://docs.oracle.com/javase/7/docs/technotes/guides/security/jaas/JAASLMDevGuide.html

这是我的两分钱。

这篇关于与J2EE用户认证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆