문제

I have two apps, server side is based on java with rest easy and client where I'm using angular js.

I used basic authentication where I generated token in first request and all requests used this token, but since I moved project to Wildfly, and there is no Tomcat this way doesn't work.

My class TokenAuthenticator extends BasicAuthenticator from Catalina;

web.xml has:

<login-config>
    <realm-name>App</realm-name>
</login-config>

<security-role>
    <role-name>user</role-name>
</security-role>

and jboss-web.xml:

<jboss-web>
    <security-domain>App</security-domain>
    <valve>
        <class-name>package.TokenAuthenticator</class-name>
    </valve>
    <context-root>/app-server</context-root>
</jboss-web>

In my EJB beans I'm using @RolesAllowed annotation to restrict access to resources.

I read that for now, Wildfly doesn't support valves.

What is my the best alternative?

도움이 되었습니까?

해결책

I've changed my mind and implemented form based authentication, but answering on my previous question, I should write a ServletExtension which adds an AuthenticationMechanism to DeploymentInfo. In AuthenticationMechanism, there is a authenticate() method, which authenticate users. You can find a bit info in Undertow documentation.

Probably (before final) they will allow configuration via XML.

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