Being locked out of your own Immich server is a bad moment. The server image ships an admin tool that can reset the admin password from inside the container.
Connect to the immich_server container and run the command:
docker exec -it immich_server immich-admin reset-admin-password
It finds the admin user, shows the ID and email, and asks for a new password, which is optional. The next question is whether to invalidate existing sessions. Say yes if you think somebody else may be logged in as the admin.
The same tool has more commands that are handy when a login goes wrong:
enable-password-loginanddisable-password-loginswitch password login on or off, for example when OAuth is the only login you wantlist-usersprints the users, andgrant-adminandrevoke-adminchange admin rights by emailenable-maintenance-modeanddisable-maintenance-modeput the server in maintenance, with a login URL that contains a token
The caveat is that anyone with shell access to the Docker host can do this, so it is a reason to guard that access, not a flaw in Immich. And only use disable-password-login once OAuth login works; enable-password-login turns password login back on.
I am assuming your container is called immich_server, as in the docs. Check the name with docker ps if you renamed it.
Further reading: Server commands (Immich docs)
Going deeper: Guide: link Prowlarr to Sonarr and Radarr once, and stop typing indexers into every app