I realize this is pretty old, but have you tried the ENABLE_AUTO_REGISTRATION = trueflag combined with the ACCOUNT_LINKING = auto flag? I think that might give you your desired behavior. It will skip the screen that allows users to set their username/email when logging in for the first time via OIDC. If no user with the IdP-provided email exists, it will create a new user, whereas if a user with the IdP-provided email already exists, it will link that login to the existing user. Users won’t have a chance to set those parameters.
Thanks for the advice. It helped somehow but ended in a internal server error 500 in gitea.
It seems like Gitea can’t resolve the openid/ oauth2 attributes from authelia.
So I tried to set the config keys OPENID_CONNECT_SCOPES, and USERNAME but can’t find the correct values therefore.