用户授权 Java SE

发布于 2024-10-18 02:38:31 字数 119 浏览 5 评论 0原文

我需要创建具有不同用户角色(管理员和简单用户)的用户授权。管理员将拥有更多的功能。 那么,我应该使用哪些类或引擎来实现对我的桌面应用程序的用户授权? 我应该使用 javax.security.auth.login 中的类吗?

I need to create a user authorization with different user's roles (admin and simple user). Admin will have more functional abilities.
So, what classes or engines should I use to implement user authorization to my destkop application?
Should I use classes in javax.security.auth.login?

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

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

发布评论

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

评论(3

花开柳相依 2024-10-25 02:38:31

在桌面应用程序中实现授权的两种最常见方法是:

  • Java 身份验证和授权服务 ( JAAS
  • 自行开发,可以完全从头开始,也可以使用 LDAP 之类的东西来存储和检查用户凭据。

The two most common ways to implement authorization in a desktop application are:

  • Java Authentication and Authorization Service (JAAS)
  • Roll your own, either entirely from scratch or using something like LDAP for storing and checking user credentials.
转瞬即逝 2024-10-25 02:38:31

如果您还没有,请查看 Apache Shiro。它比 JAAS 更容易使用,并且可以与任何类型的应用程序一起使用,无论是桌面应用程序、基于 Web 的应用程序还是移动应用程序。

If you haven't already, check out Apache Shiro. It's MUCH easier to work with than JAAS and will work with any kind of application, whether it's desktop, web based, or mobile.

彩扇题诗 2024-10-25 02:38:31

Bouncy Castle 拥有良好的密码加密系统。您可以使用数据库或 XML 文件来存储用户和角色数据。密码必须加密。然后解决 JMenuBar 和 JMenu 的问题,以启用/禁用或设置为可见/不可见每个角色应该看到的内容。使用此解决方案,您只需要 Bouncy-Castle 罐子。

Bouncy Castle have a good password encryption system. You can use a database or an XML file to store the users and roles data. The password must be encrypted. Then work around your JMenuBar and JMenu's to enable/disable or set to visible/not-visible what every role is supposed to see. With this solution you only need the Bouncy-Castle jar.

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