{"action":"created","comment":{"url":"https://api.github.com/repos/edx/edx-platform/pulls/comments/34683353","id":34683353,"diff_hunk":"@@ -0,0 +1,142 @@\n+import logging\n+import calendar\n+import time\n+\n+from django.contrib.auth import REDIRECT_FIELD_NAME, logout\n+from oauthlib.common import Request\n+from oauthlib.oauth1.rfc5849.signature import normalize_base_string_uri, normalize_parameters, collect_parameters, \\\n+    construct_base_string, sign_hmac_sha1","path":"common/djangoapps/third_party_auth/lti.py","position":8,"original_position":8,"commit_id":"8b8466fb59cc547c15067d11ea80d30fca01eeee","original_commit_id":"8b8466fb59cc547c15067d11ea80d30fca01eeee","user":{"login":"sarina","id":1985317,"avatar_url":"https://avatars.githubusercontent.com/u/1985317?v=3","gravatar_id":"","url":"https://api.github.com/users/sarina","html_url":"https://github.com/sarina","followers_url":"https://api.github.com/users/sarina/followers","following_url":"https://api.github.com/users/sarina/following{/other_user}","gists_url":"https://api.github.com/users/sarina/gists{/gist_id}","starred_url":"https://api.github.com/users/sarina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sarina/subscriptions","organizations_url":"https://api.github.com/users/sarina/orgs","repos_url":"https://api.github.com/users/sarina/repos","events_url":"https://api.github.com/users/sarina/events{/privacy}","received_events_url":"https://api.github.com/users/sarina/received_events","type":"User","site_admin":false},"body":"Nit: So that future import changes create a clean diff, I prefer doing\r\n```python\r\nfrom some_lib import (\r\n    thing1,\r\n    thing2,\r\n)\r\n```","created_at":"2015-07-15T14:27:33Z","updated_at":"2015-07-15T14:27:33Z","html_url":"https://github.com/edx/edx-platform/pull/8930#discussion_r34683353","pull_request_url":"https://api.github.com/repos/edx/edx-platform/pulls/8930","_links":{"self":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/comments/34683353"},"html":{"href":"https://github.com/edx/edx-platform/pull/8930#discussion_r34683353"},"pull_request":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/8930"}}},"pull_request":{"url":"https://api.github.com/repos/edx/edx-platform/pulls/8930","id":39967322,"html_url":"https://github.com/edx/edx-platform/pull/8930","diff_url":"https://github.com/edx/edx-platform/pull/8930.diff","patch_url":"https://github.com/edx/edx-platform/pull/8930.patch","issue_url":"https://api.github.com/repos/edx/edx-platform/issues/8930","number":8930,"state":"open","locked":false,"title":"Feature: LTI third-party-auth providers","user":{"login":"wmono","id":374925,"avatar_url":"https://avatars.githubusercontent.com/u/374925?v=3","gravatar_id":"","url":"https://api.github.com/users/wmono","html_url":"https://github.com/wmono","followers_url":"https://api.github.com/users/wmono/followers","following_url":"https://api.github.com/users/wmono/following{/other_user}","gists_url":"https://api.github.com/users/wmono/gists{/gist_id}","starred_url":"https://api.github.com/users/wmono/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wmono/subscriptions","organizations_url":"https://api.github.com/users/wmono/orgs","repos_url":"https://api.github.com/users/wmono/repos","events_url":"https://api.github.com/users/wmono/events{/privacy}","received_events_url":"https://api.github.com/users/wmono/received_events","type":"User","site_admin":false},"body":"Based on top of PR #8140, this change permits Learning Tools Interoperability (LTI) tool consumer applications to perform a session transfer into edX instances.\r\n\r\nAs the LTI login process is significantly different from other python-social auth providers (in particular, logins cannot be initiated by the application as there is no login page to redirect to) this auth provider has been added to third-party-auth instead.\r\n\r\nBackground reading: [Basic LTI implementation guide](http://www.imsglobal.org/lti/blti/bltiv1p0/ltiBLTIimgv1p0.html)\r\n\r\nTo test this change, first configure a LTI tool consumer in the Django admin interface, making up a consumer key and consumer secret as one would for an OAuth auth provider, then use the [LTI tool consumer reference implementation](http://www.imsglobal.org/developers/LTI/test/v1p1/lms.php) to launch https://yourserver.example.com/auth/login/lti/ . The trailing slash is mandatory.\r\n\r\nUnfortunately, the consumer/provider names can be awkward: edX is acting as an LTI tool provider -- that is, it is providing itself as a tool to an external tool consumer application -- but it does so by accepting that tool consumer as a third-party-auth auth provider.\r\n\r\nWe've been working with @ebporter on this change. Please note that this change is distinct from the similar work in PR #8347 as this one creates/associates fully functional users; the intent here is to use LTI as a session transfer mechanism, whereas the intent there is to embed edX into another application. Further work to merge these two approaches is under discussion.\r\n","created_at":"2015-07-14T21:52:45Z","updated_at":"2015-07-15T14:27:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"510f47a3aa2b33c0d493659f9de59dafd91ca941","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/edx/edx-platform/pulls/8930/commits","review_comments_url":"https://api.github.com/repos/edx/edx-platform/pulls/8930/comments","review_comment_url":"https://api.github.com/repos/edx/edx-platform/pulls/comments{/number}","comments_url":"https://api.github.com/repos/edx/edx-platform/issues/8930/comments","statuses_url":"https://api.github.com/repos/edx/edx-platform/statuses/8b8466fb59cc547c15067d11ea80d30fca01eeee","head":{"label":"ubc:wmono/lti-sso","ref":"wmono/lti-sso","sha":"8b8466fb59cc547c15067d11ea80d30fca01eeee","user":{"login":"ubc","id":1396118,"avatar_url":"https://avatars.githubusercontent.com/u/1396118?v=3","gravatar_id":"","url":"https://api.github.com/users/ubc","html_url":"https://github.com/ubc","followers_url":"https://api.github.com/users/ubc/followers","following_url":"https://api.github.com/users/ubc/following{/other_user}","gists_url":"https://api.github.com/users/ubc/gists{/gist_id}","starred_url":"https://api.github.com/users/ubc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ubc/subscriptions","organizations_url":"https://api.github.com/users/ubc/orgs","repos_url":"https://api.github.com/users/ubc/repos","events_url":"https://api.github.com/users/ubc/events{/privacy}","received_events_url":"https://api.github.com/users/ubc/received_events","type":"Organization","site_admin":false},"repo":{"id":30890299,"name":"edx-platform","full_name":"ubc/edx-platform","owner":{"login":"ubc","id":1396118,"avatar_url":"https://avatars.githubusercontent.com/u/1396118?v=3","gravatar_id":"","url":"https://api.github.com/users/ubc","html_url":"https://github.com/ubc","followers_url":"https://api.github.com/users/ubc/followers","following_url":"https://api.github.com/users/ubc/following{/other_user}","gists_url":"https://api.github.com/users/ubc/gists{/gist_id}","starred_url":"https://api.github.com/users/ubc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ubc/subscriptions","organizations_url":"https://api.github.com/users/ubc/orgs","repos_url":"https://api.github.com/users/ubc/repos","events_url":"https://api.github.com/users/ubc/events{/privacy}","received_events_url":"https://api.github.com/users/ubc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ubc/edx-platform","description":"Open edX, the edX platform that powers http://edx.org","fork":true,"url":"https://api.github.com/repos/ubc/edx-platform","forks_url":"https://api.github.com/repos/ubc/edx-platform/forks","keys_url":"https://api.github.com/repos/ubc/edx-platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ubc/edx-platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ubc/edx-platform/teams","hooks_url":"https://api.github.com/repos/ubc/edx-platform/hooks","issue_events_url":"https://api.github.com/repos/ubc/edx-platform/issues/events{/number}","events_url":"https://api.github.com/repos/ubc/edx-platform/events","assignees_url":"https://api.github.com/repos/ubc/edx-platform/assignees{/user}","branches_url":"https://api.github.com/repos/ubc/edx-platform/branches{/branch}","tags_url":"https://api.github.com/repos/ubc/edx-platform/tags","blobs_url":"https://api.github.com/repos/ubc/edx-platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ubc/edx-platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ubc/edx-platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/ubc/edx-platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ubc/edx-platform/statuses/{sha}","languages_url":"https://api.github.com/repos/ubc/edx-platform/languages","stargazers_url":"https://api.github.com/repos/ubc/edx-platform/stargazers","contributors_url":"https://api.github.com/repos/ubc/edx-platform/contributors","subscribers_url":"https://api.github.com/repos/ubc/edx-platform/subscribers","subscription_url":"https://api.github.com/repos/ubc/edx-platform/subscription","commits_url":"https://api.github.com/repos/ubc/edx-platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/ubc/edx-platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/ubc/edx-platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/ubc/edx-platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/ubc/edx-platform/contents/{+path}","compare_url":"https://api.github.com/repos/ubc/edx-platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ubc/edx-platform/merges","archive_url":"https://api.github.com/repos/ubc/edx-platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ubc/edx-platform/downloads","issues_url":"https://api.github.com/repos/ubc/edx-platform/issues{/number}","pulls_url":"https://api.github.com/repos/ubc/edx-platform/pulls{/number}","milestones_url":"https://api.github.com/repos/ubc/edx-platform/milestones{/number}","notifications_url":"https://api.github.com/repos/ubc/edx-platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ubc/edx-platform/labels{/name}","releases_url":"https://api.github.com/repos/ubc/edx-platform/releases{/id}","created_at":"2015-02-16T21:54:25Z","updated_at":"2015-02-16T22:40:45Z","pushed_at":"2015-07-14T22:24:12Z","git_url":"git://github.com/ubc/edx-platform.git","ssh_url":"git@github.com:ubc/edx-platform.git","clone_url":"https://github.com/ubc/edx-platform.git","svn_url":"https://github.com/ubc/edx-platform","homepage":"http://openedx.org/","size":448361,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"release"}},"base":{"label":"edx:master","ref":"master","sha":"a930fec852792da295274ce42c0cef8259baad45","user":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"repo":{"id":10391073,"name":"edx-platform","full_name":"edx/edx-platform","owner":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/edx/edx-platform","description":"The Open edX platform, the software that powers edX!","fork":false,"url":"https://api.github.com/repos/edx/edx-platform","forks_url":"https://api.github.com/repos/edx/edx-platform/forks","keys_url":"https://api.github.com/repos/edx/edx-platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edx/edx-platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edx/edx-platform/teams","hooks_url":"https://api.github.com/repos/edx/edx-platform/hooks","issue_events_url":"https://api.github.com/repos/edx/edx-platform/issues/events{/number}","events_url":"https://api.github.com/repos/edx/edx-platform/events","assignees_url":"https://api.github.com/repos/edx/edx-platform/assignees{/user}","branches_url":"https://api.github.com/repos/edx/edx-platform/branches{/branch}","tags_url":"https://api.github.com/repos/edx/edx-platform/tags","blobs_url":"https://api.github.com/repos/edx/edx-platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edx/edx-platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edx/edx-platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/edx/edx-platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edx/edx-platform/statuses/{sha}","languages_url":"https://api.github.com/repos/edx/edx-platform/languages","stargazers_url":"https://api.github.com/repos/edx/edx-platform/stargazers","contributors_url":"https://api.github.com/repos/edx/edx-platform/contributors","subscribers_url":"https://api.github.com/repos/edx/edx-platform/subscribers","subscription_url":"https://api.github.com/repos/edx/edx-platform/subscription","commits_url":"https://api.github.com/repos/edx/edx-platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/edx/edx-platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/edx/edx-platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/edx/edx-platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/edx/edx-platform/contents/{+path}","compare_url":"https://api.github.com/repos/edx/edx-platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edx/edx-platform/merges","archive_url":"https://api.github.com/repos/edx/edx-platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edx/edx-platform/downloads","issues_url":"https://api.github.com/repos/edx/edx-platform/issues{/number}","pulls_url":"https://api.github.com/repos/edx/edx-platform/pulls{/number}","milestones_url":"https://api.github.com/repos/edx/edx-platform/milestones{/number}","notifications_url":"https://api.github.com/repos/edx/edx-platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edx/edx-platform/labels{/name}","releases_url":"https://api.github.com/repos/edx/edx-platform/releases{/id}","created_at":"2013-05-30T20:20:38Z","updated_at":"2015-07-15T10:23:02Z","pushed_at":"2015-07-15T14:16:45Z","git_url":"git://github.com/edx/edx-platform.git","ssh_url":"git@github.com:edx/edx-platform.git","clone_url":"https://github.com/edx/edx-platform.git","svn_url":"https://github.com/edx/edx-platform","homepage":"http://open.edx.org/","size":2070183,"stargazers_count":2046,"watchers_count":2046,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1189,"mirror_url":null,"open_issues_count":156,"forks":1189,"open_issues":156,"watchers":2046,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/8930"},"html":{"href":"https://github.com/edx/edx-platform/pull/8930"},"issue":{"href":"https://api.github.com/repos/edx/edx-platform/issues/8930"},"comments":{"href":"https://api.github.com/repos/edx/edx-platform/issues/8930/comments"},"review_comments":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/8930/comments"},"review_comment":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/8930/commits"},"statuses":{"href":"https://api.github.com/repos/edx/edx-platform/statuses/8b8466fb59cc547c15067d11ea80d30fca01eeee"}}}}