Starting with QGIS 3.20, users can now easily export and import authentication configurations via a pair of actions in QGIS settings' authentication panel. Exported configurations can be password-protected to avoid sensitive information leakage.
This greatly eases sharing of various authentication configurations across multiple QGIS users, especially when it comes to more complex configuration methods such as oauth2.