我用纯 jax-rs 前端界面创建了我的第一个 Java EE 7 应用程序。一切都经过测试并且工作正常。现在我想应用一个安全层(基于角色,应用于资源或方法)。我对最终想要的东西有清晰的想象(不知道这是否有意义),但我不确定如何到达那里(使用什么成分,按什么顺序)。所以这就是我想要的:
- 我想使用 wildfly 作为身份提供者(wildfly 应该存储用户凭据 - 在数据库中,加密)
- 我的应用程序完全基于休息,所以我需要一些方法将身份验证信息放入请求(令牌?!)
- 基本身份验证就可以(每个用户都必须经过身份验证),不需要表单,不需要自我注册
- 限制对某些资源/方法的访问,我想使用 Java EE 7 标准(注释、拦截器......)
这有意义吗?如果是,是否有以相同方式或至少非常相似的示例或文档?我找到了jboss-picketlink-quickstarts但这包含许多示例,我不确定哪个最适合。我需要纠察链接吗?
由于我的持久层中有一个带有“UserRole”(枚举)的“用户”,我认为我需要从 IDP(Wildfly)和我自己提供的角色中进行某种映射 - 对吧?