Note that it's more "how i did it", not "how you should do it", but i'm not aware of a better way to do it
- Assume you've already enabled OIDC for users, and figured out Dynamic user creation - so now anyone having an account with your selected OIDC provider can have a user account at your SFTPGo server. Nice!
-
You probably noticed that when an admin tries to login - the
pre_login_hookdoesn't fire, so you can't dynamically create admins. Moreover, the admin login page doesn't have a button to login with openid! -
first enable the
implitcit_rolessetting - it will add "login with openid" button to the admin login page -
To create an admin OIDC user, create a new admin user with the same username as OIDC provides. If you're not sure what username it is - just login as normal user (i.e. create a normal SFTPGo user for this OIDC user), and check its username.
-
After that, confirm that you can login as the admin user using OIDC, and disable password login by setting
disabled_login_methodsto 12.