문제

I have an ear project with war and ejb. Using omnifaces, I normally set the error message in the war project. But on one project I'm using picketlink for authentication, and unfortunately I need to move my @Picketlink annotated class inside the ejb, otherwise it won't work.

Then my authentication classes are also in the ejb project, then the problem when the user enter a wrong credential I need to show a localized error. How do I do that in the ejb project?

Or is there a way to make picketlink work moving the authentication classes back to the war project.

Sample codes: Authentication class:

@PicketLink
public class PicketlinkAuthenticator extends BaseAuthenticator { }

JBoss deployment file

<?xml version='1.0' encoding='UTF-8'?>
<jboss-deployment-structure>

    <ear-subdeployments-isolated>true</ear-subdeployments-isolated>

    <sub-deployment name="my-project-web.war">
        <dependencies>
            <module name="org.picketlink" />
        </dependencies>
    </sub-deployment>

</jboss-deployment-structure>

Thanks

도움이 되었습니까?

해결책

I've found 2 solutions with my problem:

1.) Move the authentication classes (picketlink) to the web layer, so that the message can be set and localized.

2.) Implement a JPA IDMConfiguration in the ejb layer. And an authentication class in the web layer. Refer to this project from github: picketlink-authorization-idm-jpa. In this way we've created a picketlink resource that we will use in web layer authentication.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top