Resetting a password using a JA

user.setPassword(someString); user.commit(); Core.login(user.getName(), someString); The above mentioned code does not work. Can someone point me in the direction of how i can get a password reset for a given user and then login using that password? Yes, I am aware of the security risks in doing such a thing :)
2 answers

What is your Core.login suppossed to do?

Core.login will create a new session for that user (which is returned from the call), not replace the one you are currently using. So your code will behave as you defined but will do effectively nothing useful as nobody knows about the session you just created.


Maybe the java action executeMicroflowAsUser from the community commons function library can point you in the desired direction?