I am trying to implement a script that calls a second nested script to create a User, the User object is returned to the calling script, and then the script calls AuthenticatorService.setAuthenticated(userId from the newly created User).
The script throws an exception when calling setAuthenticated(), as follows.
May 06, 2015 10:35:13 AM net.datenwerke.security.service.authenticator.AuthenticatorServiceImpl setAuthenticated
WARNING: Something went terribly wrong. UserId (320919) does not point at user.
net.datenwerke.security.service.authenticator.exceptions.AuthenticatorRuntimeException: Something went terribly wrong. UserId (320919) does not point at user.
My assumption is that the second nested script isn’t actually committed when it completes and returns the User object back to the calling script. Is this the case? If so, is there any other way I can force the nested script to commit so that the calling script can successfully call setAuthenticated with the newly created user? Or any other suggestions how to accomplish this?
I did not make any change in the httpauthexecute.cf file (although I’m now wondering if maybe I need to do something in here such that the script will execute / commit things properly?) → Nevermind this line, I realized this is for reports, not scripts
Even if I remove the line of code in the main script that is failing (authenticatorService.setAuthenticated(userFromAD.getId() ), the User object is still not being created in the database
Hi Alana,
scripts executed via scriptAccess are per default executed in uncommitting mode (ie similar to using exec without the -c modifier). In order to have this in committing mode you need to add the url parameter “commit=true”.
Thanks very much! Once I added “commit=true” to my URL it worked properly - the user was created/committed in my nested script, and the setAuthenticated(new user) in the main script was successful.
I have a problem with ‘commit’ url parameter on reportserver 3.0.3. Actually it doesn’t have any effect.
In the script I create new user and then save it with persist(). On my local machine 3.0.7 it does work as expected, but when I run the same script on the dev server it doesn’t.
The user is created, after persist the script returns user.getId(), but after script execution there is no such user anywhere in the system.