custom errai.authentication_adapter
juandavidr Mar 28, 2012 6:06 PMHi all,
I'm new to errai and i'm trying to use the authentication methods wich will help me secure my app. i've tryied to use both, a custom Authentication adapter, and the JAASAdapter provided by errai, but i havent been able to get the bus to authenticate, is there somthing i'm missing? i'm always getting the following error:
16:56:07,984 ERROR [STDERR] Exception in thread "Thread-17" java.lang.RuntimeException: scheduler interrupted by exception
16:56:07,984 ERROR [STDERR] at org.jboss.errai.bus.server.async.SimpleSchedulerService.run(SimpleSchedulerService.java:87)
16:56:07,984 ERROR [STDERR] at java.lang.Thread.run(Thread.java:662)
16:56:07,984 ERROR [STDERR] Caused by: org.jboss.errai.bus.client.api.base.NoSubscribersToDeliverTo: no subscribers to deliver to for subject: LoginCli
ent
16:56:07,984 ERROR [STDERR] at org.jboss.errai.bus.server.ServerMessageBusImpl.delayOrFail(ServerMessageBusImpl.java:388)
16:56:07,984 ERROR [STDERR] at org.jboss.errai.bus.server.ServerMessageBusImpl.enqueueForDelivery(ServerMessageBusImpl.java:496)
16:56:07,984 ERROR [STDERR] at org.jboss.errai.bus.server.ServerMessageBusImpl.access$1000(ServerMessageBusImpl.java:49)
16:56:08,000 ERROR [STDERR] at org.jboss.errai.bus.server.ServerMessageBusImpl$8.run(ServerMessageBusImpl.java:499)
16:56:08,000 ERROR [STDERR] at org.jboss.errai.bus.server.ServerMessageBusImpl$6.run(ServerMessageBusImpl.java:403)
16:56:08,000 ERROR [STDERR] at org.jboss.errai.bus.server.async.TimedTask.runIfDue(TimedTask.java:104)
16:56:08,000 ERROR [STDERR] at org.jboss.errai.bus.server.async.SimpleSchedulerService.runAllDue(SimpleSchedulerService.java:124)
16:56:08,000 ERROR [STDERR] at org.jboss.errai.bus.server.async.SimpleSchedulerService.run(SimpleSchedulerService.java:76)
16:56:08,000 ERROR [STDERR] ... 1 more
i'm using errai 1.3.2-Final gwt-2.4.0 and jboss 6.1 and a custom login module for JAAS.
the following is my config:
ErraiService.properties:
##
## Specify the Authentication/Authorization Adapter to use
##
#errai.authentication_adapter=com.heinsohn.front.client.security.FOTAdaptadorAutenticacion
errai.authentication_adapter=org.jboss.errai.bus.server.security.auth.JAASAdapter
##
## This property indicates whether or not authentication is required for all communication with the bus. Set this
## to 'true' if all access to your application should be secure.
##
errai.require_authentication_for_all=true
#
# (Optional) A Login MOTD sendNowWith be sent sendNowWith the client upon successful login.
#
errai.login_motd=UNAUTHORIZED ACCESS IS PROHIBITED!
login.config:
Login {
com.heinsohn.front.services.core5.security.FOTLoginModule required ;
org.jboss.security.ClientLoginModule required useFirstPass=true;
};
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<listener>
<listener-class>com.heinsohn.front.web.server.LanzarCiclo</listener-class>
</listener>
<servlet>
<servlet-name>ErraiServlet</servlet-name>
<servlet-class>org.jboss.errai.bus.server.servlet.DefaultBlockingServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>ErraiServlet</servlet-name>
<url-pattern>*.erraiBus</url-pattern>
</servlet-mapping>
<!-- Default page to serve -->
<welcome-file-list>
<welcome-file>front-view.html</welcome-file>
</welcome-file-list>
<security-constraint>
<display-name>Accept only authenticated users</display-name>
<web-resource-collection>
<web-resource-name>All files</web-resource-name>
<url-pattern>/*</url-pattern>
<http-method>POST</http-method>
<http-method>GET</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>Guest</role-name>
<role-name>Admin</role-name>
<role-name>User</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>FOTLoginModule</realm-name>
</login-config>
<security-role>
<role-name>Guest</role-name>
</security-role>
<security-role>
<role-name>Admin</role-name>
</security-role>
<security-role>
<role-name>User</role-name>
</security-role>
</web-app>