Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
I am setting a password of an existing user, is it possible that setting this password will reset the security token as well ?
Yes, Chirag. I confirm that setting password with system.setPassword() does change the security token and also send it to the user through Email, I have tried it.
Yes it does. If you are trying to use setPassword() with an API user, consider creating a custom API profile with the "Password Never Expires" permission turned on.