Question on using LoginClient
jdestef Oct 12, 2012 8:31 AMHi,
Trying to get login working with 2.1.0-Final. I have read the discussion at https://community.jboss.org/thread/197641. My app is configured with the JAAS adapter as follows:
errai.authentication_adapter=org.jboss.errai.bus.server.security.auth.JAASAdapter
errai.require_authentication_for_all=true
errai.login_motd=UNAUTHORIZED ACCESS IS PROHIBITED!
Login config:
Login {
org.jboss.errai.bus.server.security.auth.PropertyFileLoginModule sufficient;
};
I have a service annotated with @RequireAuthentication. In the entry point of the app in a method that fires after initialization I subscribe to the "LoginClient" as follows (test code for now):
bus.subscribe("LoginClient", new MessageCallback() {
@Override
public void callback(Message message) {
if (message.getCommandType().equals("FailedAuth")) {
fail("Authentication failed");
} else if (message.getCommandType().equals("SuccessfulAuth")) {
// navigate to new page
} else {
MessageBuilder.createConversation(message)
.subjectProvided()
.command(SecurityCommands.AuthRequest)
.with(MessageParts.ReplyTo, "LoginClient")
.with(SecurityParts.Name, user.getUsername())
.with(SecurityParts.Password, user.getPassword()).done()
.reply();
}
}
});
From the application I call the annotated service. The service call takes place without call back to the login client first?
There was also some discussion in the post I mentioned about aditional documentation around using the login service. Is that available?
Thanks