{"id":19592232,"url":"https://github.com/catalyst/moodle-auth_basic","last_synced_at":"2025-07-17T14:08:00.860Z","repository":{"id":42992905,"uuid":"55935328","full_name":"catalyst/moodle-auth_basic","owner":"catalyst","description":"Moodle Basic Authentication, easily test using curl, webpage test, page speed etc","archived":false,"fork":false,"pushed_at":"2025-03-31T11:47:18.000Z","size":96,"stargazers_count":7,"open_issues_count":8,"forks_count":6,"subscribers_count":24,"default_branch":"MOODLE_310_STABLE","last_synced_at":"2025-04-27T14:39:07.367Z","etag":null,"topics":["basic-authentication","curl","moodle","moodle-plugin","webpagetest"],"latest_commit_sha":null,"homepage":"https://moodle.org/plugins/auth_basic","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/catalyst.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-04-11T02:25:05.000Z","updated_at":"2025-01-21T00:25:14.000Z","dependencies_parsed_at":"2025-04-27T14:43:52.365Z","dependency_job_id":null,"html_url":"https://github.com/catalyst/moodle-auth_basic","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/catalyst/moodle-auth_basic","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catalyst%2Fmoodle-auth_basic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catalyst%2Fmoodle-auth_basic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catalyst%2Fmoodle-auth_basic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catalyst%2Fmoodle-auth_basic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/catalyst","download_url":"https://codeload.github.com/catalyst/moodle-auth_basic/tar.gz/refs/heads/MOODLE_310_STABLE","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catalyst%2Fmoodle-auth_basic/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265614332,"owners_count":23798427,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["basic-authentication","curl","moodle","moodle-plugin","webpagetest"],"created_at":"2024-11-11T08:34:13.497Z","updated_at":"2025-07-17T14:08:00.839Z","avatar_url":"https://github.com/catalyst.png","language":"PHP","readme":"\u003ca href=\"https://travis-ci.org/catalyst/moodle-auth_basic\"\u003e\n\u003cimg src=\"https://travis-ci.org/catalyst/moodle-auth_basic.svg?branch=master\"\u003e\n\u003c/a\u003e\n\n* [What is this?](#what-is-this)\n* [Branches](#branches)\n* [Installation](#installation)\n* [Logging out](#logging-out)\n* [Curl example](#curl-example)\n* [Master password feature](#master-password-feature)\n* [Feedback and issues](#feedback-and-issues)\n\nWhat is this?\n========================\n\nThis is a moodle plugin which enables you to authenticate via HTTP basic auth.\n\nThis is more for development and backend purposes and allows easier testing with tools such as webpage test, page speed, link checkers etc which often can use basic auth out of the box, but you don't want to attempt to customize them in order to handle moodle specific authentication, or try to, where Moodle API access is inappropriate.\n\nYou would almost never want to use this for real human users as basic auth is a fairly terrible user experience. It is designed to work side by side with your real moodle authentication but doesn't impact on normal authentication.\n\nEven in production this has value for use cases such as performance regression testing using a real user and a real page which does a full bootstrap.\n\nUnlike the core 'no authentication' plugin, this still requires real users and does proper password checks. It can be set to ignore the auth type against the account, eg manual, ldap, smtp so can be used side by side with other auth plugins, as long as those plugins store or cache the password, ie prevent_local_passwords() returns false for those plugins. So it can only be used with existing accounts and doesn't create accounts.\n\nThere is a bonus features which is a 'master password' mode. This is definitely not for production use and you have to jump through some tiny hoops to turn it on so it can't be used accidentally. But when it's set up it enables you to not only log in as anyone with the same password, but also to randomly select who to log in as well. This makes it trivial to run things like simple 1-liner load tests using Apache Bench. See below for details.\n\n\nFrom a security perspective this auth plugin is exactly as secure as the manual auth plugin, so this should only be used in conjuntion with https.\n\nBranches\n--------\n\n| Moodle version    | Branch             | PHP  |\n| ----------------- | -------------------| ---- |\n| Moodle 3.10+      | MOODLE_310_STABLE  | 7.0+ |\n| Moodle 3.5 to 3.9 | master             | 7.0+ |\n| Totara 12+        | master             | 7.0+ |\n\n\nInstallation\n------------\n\n1. Install the plugin the same as any standard moodle plugin either via the\nMoodle plugin directory, or you can use git to clone it into your source:\n\n     ```php\n   git clone git@github.com:catalyst/moodle-auth_basic.git auth/basic\n    ```\n    Or install via the Moodle plugin directory:\n    \n     https://moodle.org/plugins/auth_basic\n\n2. Then run the Moodle upgrade\n\nIf you have issues please log them in github here:\n\nhttps://github.com/catalyst/moodle-auth_basic/issues\n\nOr if you want paid support please contact Catalyst IT Australia:\n\nhttps://www.catalyst-au.net/contact-us\n\n\nLogging out\n-----------\n\nNote that most browsers store basic auth credentials that have worked forever, so you may try to logout, then click somewhere else and find yourself immediately logged back in without being prompted. As a general rule only services will use basic auth, not humans in browsers.\n\nCurl example\n------------\n\nExample usage on the command line:\n\n```curl -c /tmp/cookies -v -L --user user:password http://my.moodle.local/course/view.php?id=123```\n\n * -c file - keep and re-use cookies\n * -v show request and response headers\n * -L follow redirects\n * --user credentials\n \n \n Master password feature\n ------------\n \n**NOT for production use**\n\nThis enables you to:\n\n1) log in as anyone with the same fixed master password\n2) also randomly select who to log in as well\n\nThis makes it trivial to run things like simple 1-liner load tests using Apache Bench.\n \nFirst add these settings to config.php to protect against accidental use:\n\n```php\n$CFG-\u003eauth_basic_enabled_master_password = true;\n```\n\nYou can also optionally also lock it down to any ip or subnet:\n\n```php\n$CFG-\u003eauth_basic_whitelist_ips = 'x.x.x.x';\n```\n\nGo to \"Site Administration \u003e Plugins \u003e Authentication \u003e Basic Authentication \u003e Master Password\" to generate Master Password\nClick on \"Regenerate Password\" button with you want to choose another password.\nClick on \"Save Password\" button to create new master password.\n\nTemplate to use with curl:\n\n* random-user: Select a random non-suspended user\n\n```curl --user random-user:masterpassword http://my.moodle.local/course/view.php?id=123```\n\n* random-role-{roleid}: Select a random non-suspended user with roleid at site level\n\n```curl --user random-role-1:masterpassword http://my.moodle.local/course/view.php?id=123```\n\n* random-course-{courseid}: Select a random non-suspended user who is enrolled in the course\n\n```curl --user random-course-10:masterpassword http://my.moodle.local/course/view.php?id=123```\n\n* random-course-{courseid}-role-{roleid}: Select a random non-suspended user who is enrolled in the course with roleid\n \n```curl --user random-course-10-role-1:masterpassword http://my.moodle.local/course/view.php?id=123```\n\n\nFeedback and issues\n-------------------\n\nPlease raise any issues in github:\n\nhttps://github.com/catalyst/moodle-auth_basic/issues\n\nIf you need anything urgently and would like to sponsor its implementation please email me: Brendan Heywood brendan@catalyst-au.net\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcatalyst%2Fmoodle-auth_basic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcatalyst%2Fmoodle-auth_basic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcatalyst%2Fmoodle-auth_basic/lists"}