{"action":"created","comment":{"url":"https://api.github.com/repos/matrix-org/matrix-doc/pulls/comments/29034195","id":29034195,"diff_hunk":"@@ -747,350 +1000,165 @@ member's state, by making a request to\n   }\n \n \n-Registration and Login\n-----------------------\n-\n-Clients must register with a home server in order to use Matrix. After\n-registering, the client will be given an access token which must be used in ALL\n-requests to that home server as a query parameter 'access_token'.\n-\n-If the client has already registered, they need to be able to login to their\n-account. The home server may provide many different ways of logging in, such as\n-user/password auth, login via a social network (OAuth2), login by confirming a\n-token sent to their email address, etc. This specification does not define how\n-home servers should authorise their users who want to login to their existing\n-accounts, but instead defines the standard interface which implementations\n-should follow so that ANY client can login to ANY home server. Clients login\n-using the |login|_ API. Clients register using the |register|_ API.\n-Registration follows the same general procedure as login, but the path requests\n-are sent to and the details contained in them are different.\n-\n-In both registration and login cases, the process takes the form of one or more\n-stages, where at each stage the client submits a set of data for a given stage\n-type and awaits a response from the server, which will either be a final\n-success or a request to perform an additional stage. This exchange continues\n-until the final success.\n-\n-In order to determine up-front what the server's requirements are, the client\n-can request from the server a complete description of all of its acceptable\n-flows of the registration or login process. It can then inspect the list of\n-returned flows looking for one for which it believes it can complete all of the\n-required stages, and perform it. As each home server may have different ways of\n-logging in, the client needs to know how they should login. All distinct login\n-stages MUST have a corresponding ``type``. A ``type`` is a namespaced string\n-which details the mechanism for logging in.\n-\n-A client may be able to login via multiple valid login flows, and should choose\n-a single flow when logging in. A flow is a series of login stages. The home\n-server MUST respond with all the valid login flows when requested by a simple\n-``GET`` request directly to the ``/login`` or ``/register`` paths::\n-\n-  {\n-    \"flows\": [\n-      {\n-        \"type\": \"<login type1a>\",\n-        \"stages\": [ \"<login type 1a>\", \"<login type 1b>\" ]\n-      },\n-      {\n-        \"type\": \"<login type2a>\",\n-        \"stages\": [ \"<login type 2a>\", \"<login type 2b>\" ]\n-      },\n-      {\n-        \"type\": \"<login type3>\"\n-      }\n-    ]\n-  }\n-\n-The client can now select which flow it wishes to use, and begin making\n-``POST`` requests to the ``/login`` or ``/register`` paths with JSON body\n-content containing the name of the stage as the ``type`` key, along with\n-whatever additional parameters are required for that login or registration type\n-(see below). After the flow is completed, the client's fully-qualified user\n-ID and a new access token MUST be returned::\n-\n-  {\n-    \"user_id\": \"@user:matrix.org\",\n-    \"access_token\": \"abcdef0123456789\"\n-  }\n+Registration\n+------------\n+This section refers to API Version 2. These API calls currently use the prefix\n+``/_matrix/client/v2_alpha``.\n \n-The ``user_id`` key is particularly useful if the home server wishes to support\n-localpart entry of usernames (e.g. \"user\" rather than \"@user:matrix.org\"), as\n-the client may not be able to determine its ``user_id`` in this case.\n+Registering for a user account is done using the request::\n \n-If the flow has multiple stages to it, the home server may wish to create a\n-session to store context between requests. If a home server responds with a\n-``session`` key to a request, clients MUST submit it in subsequent requests\n-until the flow is completed::\n+  POST $V2PREFIX/register\n \n-  {\n-    \"session\": \"<session id>\"\n-  }\n+This API endpoint uses the User-Interactive Authentication API.\n+This API endoint does not require an access token.\n \n-This specification defines the following login types:\n- - ``m.login.password``\n- - ``m.login.oauth2``\n- - ``m.login.email.code``\n- - ``m.login.email.url``\n- - ``m.login.email.identity``\n+The body of the POST request is a JSON object containing:\n \n-Password-based\n-~~~~~~~~~~~~~~\n-:Type:\n-  ``m.login.password``\n-:Description:\n-  Login is supported via a username and password.\n+username\n+  Optional. This is the local part of the desired Matrix ID. If omitted, the\n+  Home Server must generate a Matrix ID local part.\n+password\n+  Required. The desired password for the account.\n+bind_email\n+  Optional. If ``true``, the server binds the email used for authentication to","path":"specification/10_client_server_api.rst","position":377,"original_position":379,"commit_id":"fa8d8a9f954d40dc0b5e7b6f2311afce47f946ff","original_commit_id":"cfbc58c4fb06c1fe7c7a639a9868b2f93151dc9d","user":{"login":"dbkr","id":986903,"avatar_url":"https://avatars.githubusercontent.com/u/986903?v=3","gravatar_id":"","url":"https://api.github.com/users/dbkr","html_url":"https://github.com/dbkr","followers_url":"https://api.github.com/users/dbkr/followers","following_url":"https://api.github.com/users/dbkr/following{/other_user}","gists_url":"https://api.github.com/users/dbkr/gists{/gist_id}","starred_url":"https://api.github.com/users/dbkr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dbkr/subscriptions","organizations_url":"https://api.github.com/users/dbkr/orgs","repos_url":"https://api.github.com/users/dbkr/repos","events_url":"https://api.github.com/users/dbkr/events{/privacy}","received_events_url":"https://api.github.com/users/dbkr/received_events","type":"User","site_admin":false},"body":"This is how it was before except the email always got bound if the user supplied an email address: I just added the option to not bind. It's a valid point though.","created_at":"2015-04-24T09:03:50Z","updated_at":"2015-04-24T09:03:50Z","html_url":"https://github.com/matrix-org/matrix-doc/pull/15#discussion_r29034195","pull_request_url":"https://api.github.com/repos/matrix-org/matrix-doc/pulls/15","_links":{"self":{"href":"https://api.github.com/repos/matrix-org/matrix-doc/pulls/comments/29034195"},"html":{"href":"https://github.com/matrix-org/matrix-doc/pull/15#discussion_r29034195"},"pull_request":{"href":"https://api.github.com/repos/matrix-org/matrix-doc/pulls/15"}}},"pull_request":{"url":"https://api.github.com/repos/matrix-org/matrix-doc/pulls/15","id":33978091,"html_url":"https://github.com/matrix-org/matrix-doc/pull/15","diff_url":"https://github.com/matrix-org/matrix-doc/pull/15.diff","patch_url":"https://github.com/matrix-org/matrix-doc/pull/15.patch","issue_url":"https://api.github.com/repos/matrix-org/matrix-doc/issues/15","number":15,"state":"open","locked":false,"title":"Document CS API V2 auth changes and new APIs.","user":{"login":"dbkr","id":986903,"avatar_url":"https://avatars.githubusercontent.com/u/986903?v=3","gravatar_id":"","url":"https://api.github.com/users/dbkr","html_url":"https://github.com/dbkr","followers_url":"https://api.github.com/users/dbkr/followers","following_url":"https://api.github.com/users/dbkr/following{/other_user}","gists_url":"https://api.github.com/users/dbkr/gists{/gist_id}","starred_url":"https://api.github.com/users/dbkr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dbkr/subscriptions","organizations_url":"https://api.github.com/users/dbkr/orgs","repos_url":"https://api.github.com/users/dbkr/repos","events_url":"https://api.github.com/users/dbkr/events{/privacy}","received_events_url":"https://api.github.com/users/dbkr/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-04-23T17:31:15Z","updated_at":"2015-04-24T09:03:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"25432c4e1715cb5284e357a380ca6b26c039d79d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/matrix-org/matrix-doc/pulls/15/commits","review_comments_url":"https://api.github.com/repos/matrix-org/matrix-doc/pulls/15/comments","review_comment_url":"https://api.github.com/repos/matrix-org/matrix-doc/pulls/comments{/number}","comments_url":"https://api.github.com/repos/matrix-org/matrix-doc/issues/15/comments","statuses_url":"https://api.github.com/repos/matrix-org/matrix-doc/statuses/fa8d8a9f954d40dc0b5e7b6f2311afce47f946ff","head":{"label":"matrix-org:csauth","ref":"csauth","sha":"fa8d8a9f954d40dc0b5e7b6f2311afce47f946ff","user":{"login":"matrix-org","id":8418310,"avatar_url":"https://avatars.githubusercontent.com/u/8418310?v=3","gravatar_id":"","url":"https://api.github.com/users/matrix-org","html_url":"https://github.com/matrix-org","followers_url":"https://api.github.com/users/matrix-org/followers","following_url":"https://api.github.com/users/matrix-org/following{/other_user}","gists_url":"https://api.github.com/users/matrix-org/gists{/gist_id}","starred_url":"https://api.github.com/users/matrix-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matrix-org/subscriptions","organizations_url":"https://api.github.com/users/matrix-org/orgs","repos_url":"https://api.github.com/users/matrix-org/repos","events_url":"https://api.github.com/users/matrix-org/events{/privacy}","received_events_url":"https://api.github.com/users/matrix-org/received_events","type":"Organization","site_admin":false},"repo":{"id":24998719,"name":"matrix-doc","full_name":"matrix-org/matrix-doc","owner":{"login":"matrix-org","id":8418310,"avatar_url":"https://avatars.githubusercontent.com/u/8418310?v=3","gravatar_id":"","url":"https://api.github.com/users/matrix-org","html_url":"https://github.com/matrix-org","followers_url":"https://api.github.com/users/matrix-org/followers","following_url":"https://api.github.com/users/matrix-org/following{/other_user}","gists_url":"https://api.github.com/users/matrix-org/gists{/gist_id}","starred_url":"https://api.github.com/users/matrix-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matrix-org/subscriptions","organizations_url":"https://api.github.com/users/matrix-org/orgs","repos_url":"https://api.github.com/users/matrix-org/repos","events_url":"https://api.github.com/users/matrix-org/events{/privacy}","received_events_url":"https://api.github.com/users/matrix-org/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/matrix-org/matrix-doc","description":"Matrix Documentation (including The Spec)","fork":false,"url":"https://api.github.com/repos/matrix-org/matrix-doc","forks_url":"https://api.github.com/repos/matrix-org/matrix-doc/forks","keys_url":"https://api.github.com/repos/matrix-org/matrix-doc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/matrix-org/matrix-doc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/matrix-org/matrix-doc/teams","hooks_url":"https://api.github.com/repos/matrix-org/matrix-doc/hooks","issue_events_url":"https://api.github.com/repos/matrix-org/matrix-doc/issues/events{/number}","events_url":"https://api.github.com/repos/matrix-org/matrix-doc/events","assignees_url":"https://api.github.com/repos/matrix-org/matrix-doc/assignees{/user}","branches_url":"https://api.github.com/repos/matrix-org/matrix-doc/branches{/branch}","tags_url":"https://api.github.com/repos/matrix-org/matrix-doc/tags","blobs_url":"https://api.github.com/repos/matrix-org/matrix-doc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/matrix-org/matrix-doc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/matrix-org/matrix-doc/git/refs{/sha}","trees_url":"https://api.github.com/repos/matrix-org/matrix-doc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/matrix-org/matrix-doc/statuses/{sha}","languages_url":"https://api.github.com/repos/matrix-org/matrix-doc/languages","stargazers_url":"https://api.github.com/repos/matrix-org/matrix-doc/stargazers","contributors_url":"https://api.github.com/repos/matrix-org/matrix-doc/contributors","subscribers_url":"https://api.github.com/repos/matrix-org/matrix-doc/subscribers","subscription_url":"https://api.github.com/repos/matrix-org/matrix-doc/subscription","commits_url":"https://api.github.com/repos/matrix-org/matrix-doc/commits{/sha}","git_commits_url":"https://api.github.com/repos/matrix-org/matrix-doc/git/commits{/sha}","comments_url":"https://api.github.com/repos/matrix-org/matrix-doc/comments{/number}","issue_comment_url":"https://api.github.com/repos/matrix-org/matrix-doc/issues/comments{/number}","contents_url":"https://api.github.com/repos/matrix-org/matrix-doc/contents/{+path}","compare_url":"https://api.github.com/repos/matrix-org/matrix-doc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/matrix-org/matrix-doc/merges","archive_url":"https://api.github.com/repos/matrix-org/matrix-doc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/matrix-org/matrix-doc/downloads","issues_url":"https://api.github.com/repos/matrix-org/matrix-doc/issues{/number}","pulls_url":"https://api.github.com/repos/matrix-org/matrix-doc/pulls{/number}","milestones_url":"https://api.github.com/repos/matrix-org/matrix-doc/milestones{/number}","notifications_url":"https://api.github.com/repos/matrix-org/matrix-doc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/matrix-org/matrix-doc/labels{/name}","releases_url":"https://api.github.com/repos/matrix-org/matrix-doc/releases{/id}","created_at":"2014-10-09T16:41:02Z","updated_at":"2015-04-23T15:19:56Z","pushed_at":"2015-04-24T08:57:20Z","git_url":"git://github.com/matrix-org/matrix-doc.git","ssh_url":"git@github.com:matrix-org/matrix-doc.git","clone_url":"https://github.com/matrix-org/matrix-doc.git","svn_url":"https://github.com/matrix-org/matrix-doc","homepage":null,"size":1918,"stargazers_count":12,"watchers_count":12,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":5,"forks":3,"open_issues":5,"watchers":12,"default_branch":"master"}},"base":{"label":"matrix-org:master","ref":"master","sha":"04086975bdc0c395d562ce62dd22e563473b890b","user":{"login":"matrix-org","id":8418310,"avatar_url":"https://avatars.githubusercontent.com/u/8418310?v=3","gravatar_id":"","url":"https://api.github.com/users/matrix-org","html_url":"https://github.com/matrix-org","followers_url":"https://api.github.com/users/matrix-org/followers","following_url":"https://api.github.com/users/matrix-org/following{/other_user}","gists_url":"https://api.github.com/users/matrix-org/gists{/gist_id}","starred_url":"https://api.github.com/users/matrix-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matrix-org/subscriptions","organizations_url":"https://api.github.com/users/matrix-org/orgs","repos_url":"https://api.github.com/users/matrix-org/repos","events_url":"https://api.github.com/users/matrix-org/events{/privacy}","received_events_url":"https://api.github.com/users/matrix-org/received_events","type":"Organization","site_admin":false},"repo":{"id":24998719,"name":"matrix-doc","full_name":"matrix-org/matrix-doc","owner":{"login":"matrix-org","id":8418310,"avatar_url":"https://avatars.githubusercontent.com/u/8418310?v=3","gravatar_id":"","url":"https://api.github.com/users/matrix-org","html_url":"https://github.com/matrix-org","followers_url":"https://api.github.com/users/matrix-org/followers","following_url":"https://api.github.com/users/matrix-org/following{/other_user}","gists_url":"https://api.github.com/users/matrix-org/gists{/gist_id}","starred_url":"https://api.github.com/users/matrix-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matrix-org/subscriptions","organizations_url":"https://api.github.com/users/matrix-org/orgs","repos_url":"https://api.github.com/users/matrix-org/repos","events_url":"https://api.github.com/users/matrix-org/events{/privacy}","received_events_url":"https://api.github.com/users/matrix-org/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/matrix-org/matrix-doc","description":"Matrix Documentation (including The Spec)","fork":false,"url":"https://api.github.com/repos/matrix-org/matrix-doc","forks_url":"https://api.github.com/repos/matrix-org/matrix-doc/forks","keys_url":"https://api.github.com/repos/matrix-org/matrix-doc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/matrix-org/matrix-doc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/matrix-org/matrix-doc/teams","hooks_url":"https://api.github.com/repos/matrix-org/matrix-doc/hooks","issue_events_url":"https://api.github.com/repos/matrix-org/matrix-doc/issues/events{/number}","events_url":"https://api.github.com/repos/matrix-org/matrix-doc/events","assignees_url":"https://api.github.com/repos/matrix-org/matrix-doc/assignees{/user}","branches_url":"https://api.github.com/repos/matrix-org/matrix-doc/branches{/branch}","tags_url":"https://api.github.com/repos/matrix-org/matrix-doc/tags","blobs_url":"https://api.github.com/repos/matrix-org/matrix-doc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/matrix-org/matrix-doc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/matrix-org/matrix-doc/git/refs{/sha}","trees_url":"https://api.github.com/repos/matrix-org/matrix-doc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/matrix-org/matrix-doc/statuses/{sha}","languages_url":"https://api.github.com/repos/matrix-org/matrix-doc/languages","stargazers_url":"https://api.github.com/repos/matrix-org/matrix-doc/stargazers","contributors_url":"https://api.github.com/repos/matrix-org/matrix-doc/contributors","subscribers_url":"https://api.github.com/repos/matrix-org/matrix-doc/subscribers","subscription_url":"https://api.github.com/repos/matrix-org/matrix-doc/subscription","commits_url":"https://api.github.com/repos/matrix-org/matrix-doc/commits{/sha}","git_commits_url":"https://api.github.com/repos/matrix-org/matrix-doc/git/commits{/sha}","comments_url":"https://api.github.com/repos/matrix-org/matrix-doc/comments{/number}","issue_comment_url":"https://api.github.com/repos/matrix-org/matrix-doc/issues/comments{/number}","contents_url":"https://api.github.com/repos/matrix-org/matrix-doc/contents/{+path}","compare_url":"https://api.github.com/repos/matrix-org/matrix-doc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/matrix-org/matrix-doc/merges","archive_url":"https://api.github.com/repos/matrix-org/matrix-doc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/matrix-org/matrix-doc/downloads","issues_url":"https://api.github.com/repos/matrix-org/matrix-doc/issues{/number}","pulls_url":"https://api.github.com/repos/matrix-org/matrix-doc/pulls{/number}","milestones_url":"https://api.github.com/repos/matrix-org/matrix-doc/milestones{/number}","notifications_url":"https://api.github.com/repos/matrix-org/matrix-doc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/matrix-org/matrix-doc/labels{/name}","releases_url":"https://api.github.com/repos/matrix-org/matrix-doc/releases{/id}","created_at":"2014-10-09T16:41:02Z","updated_at":"2015-04-23T15:19:56Z","pushed_at":"2015-04-24T08:57:20Z","git_url":"git://github.com/matrix-org/matrix-doc.git","ssh_url":"git@github.com:matrix-org/matrix-doc.git","clone_url":"https://github.com/matrix-org/matrix-doc.git","svn_url":"https://github.com/matrix-org/matrix-doc","homepage":null,"size":1918,"stargazers_count":12,"watchers_count":12,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":5,"forks":3,"open_issues":5,"watchers":12,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/matrix-org/matrix-doc/pulls/15"},"html":{"href":"https://github.com/matrix-org/matrix-doc/pull/15"},"issue":{"href":"https://api.github.com/repos/matrix-org/matrix-doc/issues/15"},"comments":{"href":"https://api.github.com/repos/matrix-org/matrix-doc/issues/15/comments"},"review_comments":{"href":"https://api.github.com/repos/matrix-org/matrix-doc/pulls/15/comments"},"review_comment":{"href":"https://api.github.com/repos/matrix-org/matrix-doc/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/matrix-org/matrix-doc/pulls/15/commits"},"statuses":{"href":"https://api.github.com/repos/matrix-org/matrix-doc/statuses/fa8d8a9f954d40dc0b5e7b6f2311afce47f946ff"}}}}