Losing access to the administrator account

Sounds absurd, but I lost access to the admin user…

I wanted to make the admin username shorter (username field), but after I decided to relogin to check the new data, the system created a new account without the admin role.

Please, tell me how can I get back access to the admin account or how can I make another user admin.

you can try editing the database, and making sure the “admins” role ( always _id 5a1702fa245d9013697656fb ) has your user’s _id in the members array.
You can do that by open a shell on the mongodb pod, and edit the users collection directly

docker compose exec mongodb bash

Or you could do that by adding some kind of UI for working with mongodb like mongoexpress

   mongoexpress:
     labels:
       - "traefik.enable=true"
       - "traefik.http.routers.mongoexpress.rule=Host(`express.localhost.openiap.io`)"
       - "traefik.http.routers.mongoexpress.entrypoints=web"
       - "traefik.http.services.mongoexpress.loadbalancer.server.port=8081"
     image: "mongo-express"
     environment:
       - ME_CONFIG_MONGODB_SERVER=mongodb

or you can try running openflow with all permissions disabled by adding

- api_bypass_perm_check=true

to environment on api, and then see if you can edit the admins role, using the UI

That helped!

I added a line to the docker-compose.yml file and the roles for configuration became available to me

Adding api_bypass_perm does not solve your problem, it leaves you system completly compromisee and insecure. So use it to fix your user and then remove the line again.

Yes, I meant that I was able to set up a new administrator on the system. After that I removed the line and restarted the containers

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.