AnsweredAssumed Answered


Question asked by turgayz on Mar 28, 2006
Latest reply on Mar 28, 2006 by turgayz
I was trying to create a node, but not from the web app - from within a scheduled job. So there is no "current user" where I am trying to create the node.

I had the trouble of authentication, and used the following first:

AuthenticationService authenticationService = serviceRegistry.getAuthenticationService();
authenticationService.authenticate("admin", "admin".toCharArray());
But obviously this is not a good idea as the admin password should have been changed.
I noticed that (in BaseAlfrescoSpringTest class for example), the following is used:

AuthenticationComponent authenticationComponent = (AuthenticationComponent) this.applicationContext
And I decided to use this in my class. But is a good idea to use this other than within a TestCase?