Manual:SessionManager and AuthManager/Troubleshooting

From MediaWiki.org
Jump to navigation Jump to search

My provider does not appear in AuthManager's internal provider lists, even though it's listed in $wgAuthManagerAutoConfig[edit]

  • You might be changing $wgAuthManagerAutoConfig too late, after AuthManager has already been initialized. You should either use the AuthManagerAutoConfig key in extension.json, a callback, or the PHP entry point of the extension. You should not use extension functions, they might run too late.
  • Some extension might still use the AuthPlugin interface and change $wgAuth. When that happens, AuthManager switches into backwards compatibility mode and skips loading primary providers (that's necessary since AuthPlugin extensions are not prepared to run alongside other authentication extensions).

My provider is creating user accounts in some external authentication service, and that service and the MediaWiki user database sometimes end up in inconsistent state[edit]

MediaWiki uses implicit transactions: all work done in the request is wrapped in a single transaction (or one per DB server), and on any exception it is rolled back. That means if, for example, a secondary provider throws an exception on account creation, the MediaWiki user will not be created. You should ensure that work done by your provider can be similarly rolled back. If you are using MediaWiki's DB layer, that just means avoiding explicit commits. If you are using something else (such as a REST API), you need to ensure it has some transaction-like ability (such as a two-step change+confirm process; you can use wfGetDB()->onTransactionIdle() to do the second step). If that's not an option, you probably should do an explicit commit on the main DB connection once you have done creating the account in the external service.

Login is broken![edit]

See Manual:How to debug/Login problems on providing actionable bug reports.