custom authenticaton service issue
kukeltje Apr 16, 2006 5:52 PMI'm looking at implementing a custom authentication service that accepts saml tickets or kerberos or whatever so authentication can be passed on to jBPM from other external systems.
In jbpm.cfg.xml the authenticator can be configured. I've seen however that JbpmContext from cvs head contains the following code
/** * sets the currently authenticated actorId. * @throws ClassCastException if another authentication service is configured then the default. */ public void setActorId(String actorId) { DefaultAuthenticationService authenticationService = (DefaultAuthenticationService) services.getAuthenticationService(); DefaultAuthenticationService defaultAuthenticationService = (DefaultAuthenticationService) authenticationService; defaultAuthenticationService.setActorId(actorId); }
This code looks kind of strange to me. Any reason the code is like it is (e.g. just not finished)
It is kind of important to have at least this part configurable, and the 3.2 docs say the default authentication service is the only one finished, but mechanisms to plugin your own are in place. Seeing the code above I have my doubts, but will at least try in a few hours.
Ok, a few hours have been reduced to a few minutes. I copied the DefaultAuthenticatonService and Factory to MyDefault.... and ran the tests. I indeed get a ClassCastException as the code above mentiones. I can try to solve this by using interfaces
Something like
/** * sets the currently authenticated actorId. */ public void setActorId(String actorId) { AuthenticationService authenticationService = services.getAuthenticationService(); authenticationService.setActorId(actorId); }
but the interface AuthenticationService needs a setActorId(String actorId) then.
Since I do not know that the direction is this code should go to I'm seeking advice. Is thes setActorId only needed for jBPM internal testing? I hope not , since I'd like to be able to run the full jBPM unit tests with all service configured like I'd use them in production as well.
Ronald