{"id":16569846,"url":"https://github.com/hochleitner/externaldatabaseauth","last_synced_at":"2026-04-14T23:34:35.397Z","repository":{"id":183152398,"uuid":"179741558","full_name":"hochleitner/ExternalDatabaseAuth","owner":"hochleitner","description":"A MediaWiki extension to authenticate users from an external MySQL/MariaDB database.","archived":false,"fork":false,"pushed_at":"2021-02-01T14:38:41.000Z","size":25,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-05T12:47:56.374Z","etag":null,"topics":["authentication","mariadb","mediawiki-extension","mysql","php"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hochleitner.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-04-05T19:19:44.000Z","updated_at":"2024-11-04T21:30:01.000Z","dependencies_parsed_at":"2023-07-23T06:39:11.350Z","dependency_job_id":null,"html_url":"https://github.com/hochleitner/ExternalDatabaseAuth","commit_stats":null,"previous_names":["hochleitner/externaldatabaseauth"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/hochleitner/ExternalDatabaseAuth","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hochleitner%2FExternalDatabaseAuth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hochleitner%2FExternalDatabaseAuth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hochleitner%2FExternalDatabaseAuth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hochleitner%2FExternalDatabaseAuth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hochleitner","download_url":"https://codeload.github.com/hochleitner/ExternalDatabaseAuth/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hochleitner%2FExternalDatabaseAuth/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31819944,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T18:05:02.291Z","status":"ssl_error","status_checked_at":"2026-04-14T18:05:01.765Z","response_time":153,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["authentication","mariadb","mediawiki-extension","mysql","php"],"created_at":"2024-10-11T21:15:20.681Z","updated_at":"2026-04-14T23:34:35.374Z","avatar_url":"https://github.com/hochleitner.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ExternalDatabaseAuth\n\nA MediaWiki extension to authenticate users from an external MySQL/MariaDB database.\n\n## Use Case / Purpose\n\nThis extension can be useful whenever you are running multiple web applications besides your MediaWiki and you are keeping all user/login data in one central MySQL or MariaDB database. To avoid having to synchronize the accounts with the MediaWiki database this extension simply connects to this external database, searches for the username or email address that was entered in the wiki's login form and - if one of the two was found - checks, if the supplied password matches the one that is stored alongside the username or email address in the external database. If user and password match, a local user (the same as the username in the external database, not the email address) is created and authentication is successful. If the local user already exists (due to a previous login) it is simply updated. Since no password is stored in your wiki's database, authentication always relies on the external database.\n\nThis extension was inspired by [ExtAuthDB](https://www.mediawiki.org/wiki/Extension:ExtAuthDB) and tries to offer the same functionality as a state of the art MediaWiki extension.\n\n## Requirements\n\n- MediaWiki 1.29.0 or above.\n- An external MySQL or MariaDB database.\n- A table containing usernames, hashed/encrypted passwords, email addresses and real names.\n\n## Installation\n\n- [Download](https://github.com/hochleitner/ExternalDatabaseAuth/releases) the latest release and place its contents into\na folder called `ExternalDatabaseAuth` in your wiki's `extensions/` folder.\n- Alternatively, you can also clone this repository into a folder called `ExternalDatabaseAuth` in your wiki's `extensions/` folder.\nSelect the latest tag/release for the most stable version or simply clone HEAD for all the latest and greatest (which\nmight contain bugs though).\n- Add the following code at the bottom of your `LocalSettings.php` and change the values to match your external database\nstructure:\n```\nwfLoadExtension( 'ExternalDatabaseAuth' );\n\n$wgExternalDatabaseAuthDatabase = [\n    'host'        =\u003e 'localhost',\n    'user'        =\u003e 'yourdatabaseuser',\n    'password'    =\u003e 'yourdatabasepassword',\n    'database'    =\u003e 'databasename',\n    'tablePrefix' =\u003e ''\n];\n$wgExternalDatabaseAuthFields = [\n    'table'        =\u003e 'tablewithlogindata',\n    'userLogin'    =\u003e 'fieldwithusernames',\n    'userPassword' =\u003e 'fieldwithpasswords',\n    'userEmail'    =\u003e 'fieldwithemailaddresses',\n    'userRealName' =\u003e 'fieldwithrealname'\n];\n$wgExternalDatabaseAuthHash = 'bcrypt';\n```\n\n-  Navigate to `Special:Version` on your wiki to verify that the extension is successfully installed.\n\n## Configuration \n\nThe following three configuration variables are available:\n\n- ``$wgExternalDatabaseAuthDatabase (array)``: Contains connection information to your external database. The\nassociative array has the following keys:\n  - ``host``: The database host (default: localhost).\n  - ``user``: The database user (default: false).\n  - ``password``: The database password (default: false).\n  - ``database``: The database name (default: false).\n  - ``tablePrefix``: Prefix for database tables (default: empty string).\n- ``$wgExternalDatabaseAuthFields (array)``: Contains information where and how the data in your external database is\nstored. The associative array has the following keys:\n  - ``table``: The name of the table containing the login data (default: false).\n  - ``userLogin``: The field containing the login names (default: false).\n  - ``userPassword``: The field containing the encrypted/hashed password for the user (default: false).\n  - ``userEmail``: The field containing the user's email address (default: false).\n  - ``userRealName``: The field containing the user's real name (default: false).\n- ``$wgExternalDatabaseAuthHash (string, default: bcrypt)``: Specifies the algorithm that was used to encrypt/hash the\npasswords in your external database (unencrypted passwords are not supported). The availability of algorithms largely depends on your PHP version. The following\nvalues are supported (along with the required PHP version whenever it's higher than MediaWiki's\nminimum requirement of 7.0.13):\n  - bcrypt\n  - argon2i (\u003e= 7.2.0)\n  - argon2id (\u003e= 7.3.0)\n  - md2\n  - md4\n  - md5\n  - sha1\n  - sha224\n  - sha256\n  - sha384\n  - sha512\n  - sha512/224 (\u003e= 7.1.0)\n  - sha512/256 (\u003e= 7.1.0)\n  - sha3-224 (\u003e= 7.1.0)\n  - sha3-256 (\u003e= 7.1.0)\n  - sha3-384 (\u003e= 7.1.0)\n  - sha3-512 (\u003e= 7.1.0)\n  - ripemd128\n  - ripemd160\n  - ripemd256\n  - ripemd320\n  - whirlpool\n  - tiger128,3\n  - tiger160,3\n  - tiger192,3\n  - tiger128,4\n  - tiger160,4\n  - tiger192,4\n  - snefru\n  - snefru256\n  - gost\n  - gost-crypto\n  - adler32\n  - crc32\n  - crc32b\n  - fnv132\n  - fnv1a32\n  - fnv164\n  - fnv1a64\n  - joaat\n  - haval128,3\n  - haval160,3\n  - haval192,3\n  - haval224,3\n  - haval256,3\n  - haval128,4\n  - haval160,4\n  - haval192,4\n  - haval224,4\n  - haval256,4\n  - haval128,5\n  - haval160,5\n  - haval192,5\n  - haval224,5\n  - haval256,5\n\n## Contributing\n\nThis extension was written out of personal need. The features as well as translations only cover the things that were\nimportant for my scenario. I am also no regular MediaWiki or extension developer and gathered my knowledge from\ndocumentation and other existing extensions.\n\nIn case you find this extension helpful, but you are missing a certain feature, feel free to create a\n[pull request](https://github.com/hochleitner/ExternalDatabaseAuth/pulls) with your proposed changes. In case you are no\ndeveloper, please open an [issue](https://github.com/hochleitner/ExternalDatabaseAuth/issues) and describe what you\nwould like to see added/changed.\n\nIf you find any bugs or have suggestions on how to improve this extension from a technical perspective, please open a\nPR or issue or contact me directly. The same goes for translations. If you'd like to see your language covered (although\nthere's only a few localized strings), send your translations via PR or issue.\n\n### Developing\n\nIn case you want to add features yourself and propose them via PR, you can use the provided development tools for\nmaintaining code quality and MediaWiki coding standards through [Composer](https://getcomposer.org/).\n\nFirst, install the development dependencies by calling\n\n    composer install\n\nTo test your code and get a thorough report, call\n\n    composer run-script test\n\nTo fix possible errors, invoke\n\n    composer run-script fix","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhochleitner%2Fexternaldatabaseauth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhochleitner%2Fexternaldatabaseauth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhochleitner%2Fexternaldatabaseauth/lists"}