{"action":"created","issue":{"url":"https://api.github.com/repos/edx/edx-platform/issues/10943","labels_url":"https://api.github.com/repos/edx/edx-platform/issues/10943/labels{/name}","comments_url":"https://api.github.com/repos/edx/edx-platform/issues/10943/comments","events_url":"https://api.github.com/repos/edx/edx-platform/issues/10943/events","html_url":"https://github.com/edx/edx-platform/pull/10943","id":121577333,"number":10943,"title":"Allow each instance to configure restrictions on allowed email addresses","user":{"login":"bradenmacdonald","id":945577,"avatar_url":"https://avatars.githubusercontent.com/u/945577?v=3","gravatar_id":"","url":"https://api.github.com/users/bradenmacdonald","html_url":"https://github.com/bradenmacdonald","followers_url":"https://api.github.com/users/bradenmacdonald/followers","following_url":"https://api.github.com/users/bradenmacdonald/following{/other_user}","gists_url":"https://api.github.com/users/bradenmacdonald/gists{/gist_id}","starred_url":"https://api.github.com/users/bradenmacdonald/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bradenmacdonald/subscriptions","organizations_url":"https://api.github.com/users/bradenmacdonald/orgs","repos_url":"https://api.github.com/users/bradenmacdonald/repos","events_url":"https://api.github.com/users/bradenmacdonald/events{/privacy}","received_events_url":"https://api.github.com/users/bradenmacdonald/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/edx/edx-platform/labels/awaiting%20prioritization","name":"awaiting prioritization","color":"fad8c7"},{"url":"https://api.github.com/repos/edx/edx-platform/labels/open-source-contribution","name":"open-source-contribution","color":"bfe5bf"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-12-10T21:06:15Z","updated_at":"2015-12-11T16:21:56Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/edx/edx-platform/pulls/10943","html_url":"https://github.com/edx/edx-platform/pull/10943","diff_url":"https://github.com/edx/edx-platform/pull/10943.diff","patch_url":"https://github.com/edx/edx-platform/pull/10943.patch"},"body":"Introduces a new optional setting, `REGISTRATION_EMAIL_PATTERNS_ALLOWED`, which can be used to restrict registration so that only users whose emails match a whitelist of allowed email patterns can register on the platform.\r\n\r\nUse cases include private schools, corporate instances, etc. where employees/students are allowed to enroll themselves in courses but the general public should not be using the content.\r\n\r\nThis is something that a couple different OpenCraft clients have requested from time to time. We've recently implemented it for [Unow](http://www.unow.fr/), and we'd like to contribute this patch to the project.\r\n\r\nNote that this does not completely prevent all use of the platform or enrollment in courses - it is still possible for people to enter a bogus email that matches against the whitelist and use the platform until required to activate their account.\r\n\r\nJIRA: [OSPR-1023](https://openedx.atlassian.net/browse/OSPR-1023)\r\n\r\n**Discussions**:\r\nhttps://groups.google.com/forum/#!topic/edx-code/xK6bb1koToo\r\n\r\n**Sandbox**:\r\nLMS: http://pr10943.sandbox.opencraft.com/ \r\nStudio: http://studio.pr10943.sandbox.opencraft.com/\r\n(Note: this works with both the \"combined\" and normal registration page but the sandbox only shows the normal one since that's our default sandbox config.)\r\n\r\n**Test Instructions**:\r\n\r\n1. Go to http://pr10943.sandbox.opencraft.com/register \r\n2. Try to register an account with an email like \"blah@example.com\". It should fail. Note: Please use \"@example.com\" or an invalid TLD like \"@testing.none\" because if you use a real domain name, someone may receive unexpected email from our sandbox.\r\n2.  Try to register with (your) \"@edx.org\" or \"@opencraft.com\" email address. It should work (see whitelist in the \"settings\" below).\r\n3. Go to http://studio.pr10943.sandbox.opencraft.com/signup and repeat steps 2-3. Use a different email address in step 2, since whatever email you used the first time will already be taken.  (something like \"bounceme123@opencraft.com\" should work).\r\n\r\n- - -\r\n**Settings**\r\n```yaml\r\nEDXAPP_ENV_EXTRA:\r\n  \"REGISTRATION_EMAIL_PATTERNS_ALLOWED\": [\".*@edx\\\\.org\", \"^.*@opencraft\\\\.com$\"]\r\n```"},"comment":{"url":"https://api.github.com/repos/edx/edx-platform/issues/comments/163979941","html_url":"https://github.com/edx/edx-platform/pull/10943#issuecomment-163979941","issue_url":"https://api.github.com/repos/edx/edx-platform/issues/10943","id":163979941,"user":{"login":"chrisndodge","id":2362917,"avatar_url":"https://avatars.githubusercontent.com/u/2362917?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisndodge","html_url":"https://github.com/chrisndodge","followers_url":"https://api.github.com/users/chrisndodge/followers","following_url":"https://api.github.com/users/chrisndodge/following{/other_user}","gists_url":"https://api.github.com/users/chrisndodge/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisndodge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisndodge/subscriptions","organizations_url":"https://api.github.com/users/chrisndodge/orgs","repos_url":"https://api.github.com/users/chrisndodge/repos","events_url":"https://api.github.com/users/chrisndodge/events{/privacy}","received_events_url":"https://api.github.com/users/chrisndodge/received_events","type":"User","site_admin":false},"created_at":"2015-12-11T16:21:56Z","updated_at":"2015-12-11T16:21:56Z","body":"Thanks @bradenmacdonald curious, I could see a demand to extend course enrollments to be likewise restricted to a given email address pattern"}}