如何在War层中实现Picketlink Authenticator [英] How can I implement Picketlink Authenticator in the war layer

查看:142
本文介绍了如何在War层中实现Picketlink Authenticator的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正如标题所说,我在war层中创建了一个用@Picketlink注释的类.请注意,我有一个耳朵部署结构(ejb,战争).

As the title say, I created a class in the war layer that is annotated with @Picketlink. Note that I have an ear deployment structure (ejb, war).

自定义身份验证器:

@PicketLink
public class PicketlinkAuthenticator extends BaseAuthenticator { }

如果我将该类放在ejb层中,则可以通过身份验证,但是当我将其放在war层中时,它似乎没有被项目抛出:

If I put that class in the ejb layer, the authentication is ok but when I put it to the war layer it seems like it's not found by the project as it's throwing:

20:49:46,027 INFO  [org.picketlink.common] (default task-10) Using logger implementation: org.picketlink.common.DefaultPicketLinkLogger
20:49:46,043 INFO  [org.picketlink.idm] (default task-10) PLIDM001000: Bootstrapping PicketLink Identity Manager
20:49:46,068 WARN  [org.picketlink.idm] (default task-10) PLIDM001101: Working directory [\tmp\pl-idm] is marked to be always created. All your existing data will be lost.
20:49:46,111 INFO  [org.picketlink.idm] (default task-10) PLIDM001100: Using working directory [\tmp\pl-idm].
20:49:46,127 DEBUG [org.picketlink.idm] (default task-10) No partitions to load from \tmp\pl-idm\pl-idm-partitions.db
20:49:46,152 DEBUG [org.picketlink.idm] (default task-10) Initializing Partition [6a373282-0173-4b7d-bd6a-ff0e5dc43436] with id [6a373282-0173-4b7d-bd6a-ff0e5dc43436].
20:49:46,153 DEBUG [org.picketlink.idm] (default task-10) Loaded Agents for Partition [6a373282-0173-4b7d-bd6a-ff0e5dc43436].
20:49:46,154 DEBUG [org.picketlink.idm] (default task-10) Loaded Credentials for Partition [6a373282-0173-4b7d-bd6a-ff0e5dc43436].

为什么不只将身份验证器移到ejb一侧? ->因为我抛出了用户过期等自定义错误,所以我需要jsf来发布这些错误消息.

Why not just move the authenticator to the ejb side? ->Because I'm throwing custom error like user expired, etc. I need jsf to post these error messages.

为什么不在Web层中移动picketlink依赖关系? ->因为我扩展了picketlink帐户的帐户已绑定到我的服务.

Why not move the picketlink dependency in the web layer? ->Because my account that extended the picketlink account is binded to my services.

正如这里所建议的,我已经在war项目中添加了picketlink模块: https://docs.jboss.org/author/display/PLINK/JBoss+Modules

As suggested here I already added the picketlink module in the war project: https://docs.jboss.org/author/display/PLINK/JBoss+Modules

<jboss-deployment-structure>
  <ear-subdeployments-isolated>false</ear-subdeployments-isolated>
  <sub-deployment name="THE-WAR-MODULE-THAT-REQUIRES-PICKETLINK.war">
    <dependencies>
      <module name="org.picketlink" />
    </dependencies>
  </sub-deployment>
</jboss-deployment-structure>

无论如何?我只想显示一些自定义错误:-(

Anyway around this? I just want to show some custom errors :-(

推荐答案

我无法解决此问题,但是我有一个解决方法,那就是将picketlink模块移至Web层并仅传递身份信息实例到需要它的服务.

I was not able to solve this problem but I have a work-around solution and that is to move the picketlink module to the web layer and just pass the identity instance to the services that need it.

这篇关于如何在War层中实现Picketlink Authenticator的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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