Use the Groovy Rescue App.

Once set up as explained in the documentation link above, you can run the following script in the rescue app

Reset superuser with Groovy
session = MgnlContext.getJCRSession('users')
superuser = session.getNode('/system/superuser') 
superuser.pswd = info.magnolia.cms.security.SecurityUtil.getBCrypt('superuser') 
session.save()

After you run the script you need to stop the web app and uncomment the filters sections in web.xml before rebooting Magnolia (refer again to Groovy Rescue App). 



  • No labels

2 Comments

  1. If you are on a devloping machine easiest is to set a breakpoint in info.magnolia.cms.security.MgnlUser.MgnlUser and set the values at runtime.

  2. I run into this frequently since I work with the platform but not the content itself, typically I don't have credentials for the resulting sites but periodically have to do maintenance or developement with h2 copies of them. I wrote a basic module that I just drop on the classpath which resets the supseruser account as a startup task. As a module, it does leave a mark in terms of a module node in the configuration workspace and obviously never use it on anything live, public or similar. https://github.com/wlfshmn/custom-magnolia-superuser-resetter