Manual reset of superadmin password?
# support
a
Hi there, lovely folks! Quick question: My superadmin password, for some reason, no longer seems to work. Sad face. 🙁 It now registers a "Email or password is invalid". How do I manually reset the password? (Is this even possible?) Background: I'm on a self-hosted AWS installation of Medplum. I had previously successfully changed the admin@example.com superadmin password from its default value a while back -- when I first installed. So, up until a few weeks ago, I was able to login with admin@example.com + "my secret personalized password" -- and this login was working fine up until a few weeks ago. The only thing that I can think that has happened that is relevant in that interval is that I've upgraded from medplum 3.3.0 to 4.3.7 . The funny thing is that the Admin login -- and every single other login still works fine -- it's just the Superadmin. All other logins and funcitonality seems to work just fine. Here's the healthcheck: https://api.progressnotes.app/healthcheck Could the upgrade to 4.3.7 have borked the superadmin password? [In case it matters, when I upgraded, I was still on Postgres 12, rather than 13+ though not sure if that is relevant.] i suppose the other possibliity is that I am perhaps misremembering my password and/or I cleared the password manager's cache which may have been autofilling the superadmin password after I upgraded? Anyhow, I was thinking about manually resetting the superadmin password by doing this: Create a temporary Lambda function that runs inside the VPC, connects to my private RDS database, and updates the superadmin password with a known value. But I wanted to run this by folks first in case that was, perhaps, not a good idea. Or if there was a better way to do this. Thanks for all your thoughts! @reshma @rahul1 @cody
c
Hey @albert_wong - bummer to hear that. I don't think there's anything in the upgrade process that would have affected the password system. Regardless, yes, your manual reset process is essentially what you would need to do. You may find it easier to use something like AWS CloudShell (https://aws.amazon.com/cloudshell/). But your lambda approach would also work. It could be a lambda or an EC2 instance or any AWS resource that you grant the appropriate permissions. Once you have access, then yes, you would need to update the
passwordHash
value in the JSON blob in the
User.content
column. Let us know if you'd like any help with that
a
Thanks so much @cody! Super appreciate your thoughtful response! You and everyone at Medplum are awesome!
Ok, in case anyone is curious -- this is absolutely doable, but a little advanced -- so just be careful out there. But basically if you're self-hosting on AWS you can use AWS Lambda in VPC to connect to private RDS instance, then you can get visibility into DB and then troubleshoot to see what's happening. In my instance, there were two users with admin@example.com (which shouldn't have happened -- it was probably my own error in changing User's email manually through console? -- not sure -- and it only takes most recent user's email / password for login which was causing the block for me). Anywho! Hope everyone is doing well! But this issue is solved ! 🙂
113 Views