{"action":"created","comment":{"url":"https://api.github.com/repos/diaspora/diaspora/pulls/comments/34410856","id":34410856,"diff_hunk":"@@ -0,0 +1,15 @@\n+<h2><%= @client.name %></h2>\n+<p>You will be redirected to <%= @redirect_uri %> with an id token if approved or an error if denied</p>\n+<ul>\n+  <% @scopes.each do |scope| %>\n+    <li><%= scope.name %></li>\n+  <% end %>\n+  <% if @request_object %>\n+    <li>Request Objects (Currently not supported)</li>\n+    <ul>\n+      <pre><%= JSON.pretty_generate @request_object.as_json %></pre>\n+    </ul>\n+  <% end %>\n+</ul>\n+<%= render 'openid_connect/authorizations/form', action: :approve %>\n+<%= render 'openid_connect/authorizations/form', action: :deny %>","path":"app/views/openid_connect/authorizations/new.html.erb","position":15,"original_position":15,"commit_id":"0b3d9d40fd7f724054752c1c3e8b06dc829ec0c6","original_commit_id":"0b3d9d40fd7f724054752c1c3e8b06dc829ec0c6","user":{"login":"theworldbright","id":6329898,"avatar_url":"https://avatars.githubusercontent.com/u/6329898?v=3","gravatar_id":"","url":"https://api.github.com/users/theworldbright","html_url":"https://github.com/theworldbright","followers_url":"https://api.github.com/users/theworldbright/followers","following_url":"https://api.github.com/users/theworldbright/following{/other_user}","gists_url":"https://api.github.com/users/theworldbright/gists{/gist_id}","starred_url":"https://api.github.com/users/theworldbright/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theworldbright/subscriptions","organizations_url":"https://api.github.com/users/theworldbright/orgs","repos_url":"https://api.github.com/users/theworldbright/repos","events_url":"https://api.github.com/users/theworldbright/events{/privacy}","received_events_url":"https://api.github.com/users/theworldbright/received_events","type":"User","site_admin":false},"body":"@AugierLe42e Yup, go ahead and modify as you wish I just added it as a stub. I'm not concentrating on the front-end/views for all these flows right now.","created_at":"2015-07-11T08:13:56Z","updated_at":"2015-07-11T08:13:56Z","html_url":"https://github.com/diaspora/diaspora/pull/6095#discussion_r34410856","pull_request_url":"https://api.github.com/repos/diaspora/diaspora/pulls/6095","_links":{"self":{"href":"https://api.github.com/repos/diaspora/diaspora/pulls/comments/34410856"},"html":{"href":"https://github.com/diaspora/diaspora/pull/6095#discussion_r34410856"},"pull_request":{"href":"https://api.github.com/repos/diaspora/diaspora/pulls/6095"}}},"pull_request":{"url":"https://api.github.com/repos/diaspora/diaspora/pulls/6095","id":37606141,"html_url":"https://github.com/diaspora/diaspora/pull/6095","diff_url":"https://github.com/diaspora/diaspora/pull/6095.diff","patch_url":"https://github.com/diaspora/diaspora/pull/6095.patch","issue_url":"https://api.github.com/repos/diaspora/diaspora/issues/6095","number":6095,"state":"open","locked":false,"title":"[WIP] OpenID Connect ","user":{"login":"AugierLe42e","id":3429231,"avatar_url":"https://avatars.githubusercontent.com/u/3429231?v=3","gravatar_id":"","url":"https://api.github.com/users/AugierLe42e","html_url":"https://github.com/AugierLe42e","followers_url":"https://api.github.com/users/AugierLe42e/followers","following_url":"https://api.github.com/users/AugierLe42e/following{/other_user}","gists_url":"https://api.github.com/users/AugierLe42e/gists{/gist_id}","starred_url":"https://api.github.com/users/AugierLe42e/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AugierLe42e/subscriptions","organizations_url":"https://api.github.com/users/AugierLe42e/orgs","repos_url":"https://api.github.com/users/AugierLe42e/repos","events_url":"https://api.github.com/users/AugierLe42e/events{/privacy}","received_events_url":"https://api.github.com/users/AugierLe42e/received_events","type":"User","site_admin":false},"body":"**Warning** : This is a very early work. Not all of this is relevant. This work is based on [Nov's sample](https://github.com/nov/openid_connect_sample) highly undocumented.\r\n\r\n**Edit** : As this is the simplest, I'm going to implement the [owner password credential grant](http://tutorials.jenkov.com/oauth2/resource-owner-credentials-request-response.html) at first. It is also the one that fits the usage for a native application, which is my initial objective. This flow only evolve one request, one response and no redirection. Then, when this works, iterate from there to add [implicit grant](http://tutorials.jenkov.com/oauth2/implicit-request-response.html) and, finally, [authorization grant](http://tutorials.jenkov.com/oauth2/authorization-code-request-response.html) which is the most complex flow.\r\n\r\nThe owner password credential grant works like this: \r\n\r\n 1. the client application submits the user credentials with `grant_type` set to `password` to the token endpoint. If the credentials are ok, the autorisation endpoint returns an access token (which is an alphanumeric string) of type `bearer` with an expiration date (24h in Nov's implementation) and a refresh token,\r\n 2. the access token can be used on the resource endpoint against resources,\r\n 3. if the access token is not valid anymore, the resource endpoint returns an error and the client appliation has to exchange the refresh token against another access token on the token endpoint or authentificate again on the autorisation endpoint.\r\n\r\nWhat I plan to do:\r\n\r\n 1. add an OAuthApplication model which contains `client_id` and `client_secret` field,\r\n 2. modify the [`user`](https://github.com/diaspora/diaspora/blob/develop/app/models/user.rb) model to have multiple OAuthApplications,\r\n 3. add a Token model similar to [Nov's `access_token`](https://github.com/nov/openid_connect_sample/blob/master/app/models/access_token.rb), each OAuthApplication has multiple Tokens.","created_at":"2015-06-12T21:29:08Z","updated_at":"2015-07-11T08:13:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"55e28638fa3ec71ff9c5d8ba6e8ef41cca521806","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/diaspora/diaspora/pulls/6095/commits","review_comments_url":"https://api.github.com/repos/diaspora/diaspora/pulls/6095/comments","review_comment_url":"https://api.github.com/repos/diaspora/diaspora/pulls/comments{/number}","comments_url":"https://api.github.com/repos/diaspora/diaspora/issues/6095/comments","statuses_url":"https://api.github.com/repos/diaspora/diaspora/statuses/0b3d9d40fd7f724054752c1c3e8b06dc829ec0c6","head":{"label":"AugierLe42e:openid","ref":"openid","sha":"0b3d9d40fd7f724054752c1c3e8b06dc829ec0c6","user":{"login":"AugierLe42e","id":3429231,"avatar_url":"https://avatars.githubusercontent.com/u/3429231?v=3","gravatar_id":"","url":"https://api.github.com/users/AugierLe42e","html_url":"https://github.com/AugierLe42e","followers_url":"https://api.github.com/users/AugierLe42e/followers","following_url":"https://api.github.com/users/AugierLe42e/following{/other_user}","gists_url":"https://api.github.com/users/AugierLe42e/gists{/gist_id}","starred_url":"https://api.github.com/users/AugierLe42e/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AugierLe42e/subscriptions","organizations_url":"https://api.github.com/users/AugierLe42e/orgs","repos_url":"https://api.github.com/users/AugierLe42e/repos","events_url":"https://api.github.com/users/AugierLe42e/events{/privacy}","received_events_url":"https://api.github.com/users/AugierLe42e/received_events","type":"User","site_admin":false},"repo":{"id":25200087,"name":"diaspora","full_name":"AugierLe42e/diaspora","owner":{"login":"AugierLe42e","id":3429231,"avatar_url":"https://avatars.githubusercontent.com/u/3429231?v=3","gravatar_id":"","url":"https://api.github.com/users/AugierLe42e","html_url":"https://github.com/AugierLe42e","followers_url":"https://api.github.com/users/AugierLe42e/followers","following_url":"https://api.github.com/users/AugierLe42e/following{/other_user}","gists_url":"https://api.github.com/users/AugierLe42e/gists{/gist_id}","starred_url":"https://api.github.com/users/AugierLe42e/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AugierLe42e/subscriptions","organizations_url":"https://api.github.com/users/AugierLe42e/orgs","repos_url":"https://api.github.com/users/AugierLe42e/repos","events_url":"https://api.github.com/users/AugierLe42e/events{/privacy}","received_events_url":"https://api.github.com/users/AugierLe42e/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/AugierLe42e/diaspora","description":"Distributed and contextual social networking","fork":true,"url":"https://api.github.com/repos/AugierLe42e/diaspora","forks_url":"https://api.github.com/repos/AugierLe42e/diaspora/forks","keys_url":"https://api.github.com/repos/AugierLe42e/diaspora/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AugierLe42e/diaspora/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AugierLe42e/diaspora/teams","hooks_url":"https://api.github.com/repos/AugierLe42e/diaspora/hooks","issue_events_url":"https://api.github.com/repos/AugierLe42e/diaspora/issues/events{/number}","events_url":"https://api.github.com/repos/AugierLe42e/diaspora/events","assignees_url":"https://api.github.com/repos/AugierLe42e/diaspora/assignees{/user}","branches_url":"https://api.github.com/repos/AugierLe42e/diaspora/branches{/branch}","tags_url":"https://api.github.com/repos/AugierLe42e/diaspora/tags","blobs_url":"https://api.github.com/repos/AugierLe42e/diaspora/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AugierLe42e/diaspora/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AugierLe42e/diaspora/git/refs{/sha}","trees_url":"https://api.github.com/repos/AugierLe42e/diaspora/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AugierLe42e/diaspora/statuses/{sha}","languages_url":"https://api.github.com/repos/AugierLe42e/diaspora/languages","stargazers_url":"https://api.github.com/repos/AugierLe42e/diaspora/stargazers","contributors_url":"https://api.github.com/repos/AugierLe42e/diaspora/contributors","subscribers_url":"https://api.github.com/repos/AugierLe42e/diaspora/subscribers","subscription_url":"https://api.github.com/repos/AugierLe42e/diaspora/subscription","commits_url":"https://api.github.com/repos/AugierLe42e/diaspora/commits{/sha}","git_commits_url":"https://api.github.com/repos/AugierLe42e/diaspora/git/commits{/sha}","comments_url":"https://api.github.com/repos/AugierLe42e/diaspora/comments{/number}","issue_comment_url":"https://api.github.com/repos/AugierLe42e/diaspora/issues/comments{/number}","contents_url":"https://api.github.com/repos/AugierLe42e/diaspora/contents/{+path}","compare_url":"https://api.github.com/repos/AugierLe42e/diaspora/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AugierLe42e/diaspora/merges","archive_url":"https://api.github.com/repos/AugierLe42e/diaspora/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AugierLe42e/diaspora/downloads","issues_url":"https://api.github.com/repos/AugierLe42e/diaspora/issues{/number}","pulls_url":"https://api.github.com/repos/AugierLe42e/diaspora/pulls{/number}","milestones_url":"https://api.github.com/repos/AugierLe42e/diaspora/milestones{/number}","notifications_url":"https://api.github.com/repos/AugierLe42e/diaspora/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AugierLe42e/diaspora/labels{/name}","releases_url":"https://api.github.com/repos/AugierLe42e/diaspora/releases{/id}","created_at":"2014-10-14T09:47:25Z","updated_at":"2015-06-14T15:25:04Z","pushed_at":"2015-07-11T07:37:27Z","git_url":"git://github.com/AugierLe42e/diaspora.git","ssh_url":"git@github.com:AugierLe42e/diaspora.git","clone_url":"https://github.com/AugierLe42e/diaspora.git","svn_url":"https://github.com/AugierLe42e/diaspora","homepage":"https://diasporafoundation.org/","size":102444,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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":"develop"}},"base":{"label":"diaspora:develop","ref":"develop","sha":"84d5a13ce1ffc952d5f3f1d1875e23f5f7ee929e","user":{"login":"diaspora","id":293207,"avatar_url":"https://avatars.githubusercontent.com/u/293207?v=3","gravatar_id":"","url":"https://api.github.com/users/diaspora","html_url":"https://github.com/diaspora","followers_url":"https://api.github.com/users/diaspora/followers","following_url":"https://api.github.com/users/diaspora/following{/other_user}","gists_url":"https://api.github.com/users/diaspora/gists{/gist_id}","starred_url":"https://api.github.com/users/diaspora/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diaspora/subscriptions","organizations_url":"https://api.github.com/users/diaspora/orgs","repos_url":"https://api.github.com/users/diaspora/repos","events_url":"https://api.github.com/users/diaspora/events{/privacy}","received_events_url":"https://api.github.com/users/diaspora/received_events","type":"Organization","site_admin":false},"repo":{"id":911765,"name":"diaspora","full_name":"diaspora/diaspora","owner":{"login":"diaspora","id":293207,"avatar_url":"https://avatars.githubusercontent.com/u/293207?v=3","gravatar_id":"","url":"https://api.github.com/users/diaspora","html_url":"https://github.com/diaspora","followers_url":"https://api.github.com/users/diaspora/followers","following_url":"https://api.github.com/users/diaspora/following{/other_user}","gists_url":"https://api.github.com/users/diaspora/gists{/gist_id}","starred_url":"https://api.github.com/users/diaspora/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diaspora/subscriptions","organizations_url":"https://api.github.com/users/diaspora/orgs","repos_url":"https://api.github.com/users/diaspora/repos","events_url":"https://api.github.com/users/diaspora/events{/privacy}","received_events_url":"https://api.github.com/users/diaspora/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/diaspora/diaspora","description":"Distributed and contextual social networking","fork":false,"url":"https://api.github.com/repos/diaspora/diaspora","forks_url":"https://api.github.com/repos/diaspora/diaspora/forks","keys_url":"https://api.github.com/repos/diaspora/diaspora/keys{/key_id}","collaborators_url":"https://api.github.com/repos/diaspora/diaspora/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/diaspora/diaspora/teams","hooks_url":"https://api.github.com/repos/diaspora/diaspora/hooks","issue_events_url":"https://api.github.com/repos/diaspora/diaspora/issues/events{/number}","events_url":"https://api.github.com/repos/diaspora/diaspora/events","assignees_url":"https://api.github.com/repos/diaspora/diaspora/assignees{/user}","branches_url":"https://api.github.com/repos/diaspora/diaspora/branches{/branch}","tags_url":"https://api.github.com/repos/diaspora/diaspora/tags","blobs_url":"https://api.github.com/repos/diaspora/diaspora/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/diaspora/diaspora/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/diaspora/diaspora/git/refs{/sha}","trees_url":"https://api.github.com/repos/diaspora/diaspora/git/trees{/sha}","statuses_url":"https://api.github.com/repos/diaspora/diaspora/statuses/{sha}","languages_url":"https://api.github.com/repos/diaspora/diaspora/languages","stargazers_url":"https://api.github.com/repos/diaspora/diaspora/stargazers","contributors_url":"https://api.github.com/repos/diaspora/diaspora/contributors","subscribers_url":"https://api.github.com/repos/diaspora/diaspora/subscribers","subscription_url":"https://api.github.com/repos/diaspora/diaspora/subscription","commits_url":"https://api.github.com/repos/diaspora/diaspora/commits{/sha}","git_commits_url":"https://api.github.com/repos/diaspora/diaspora/git/commits{/sha}","comments_url":"https://api.github.com/repos/diaspora/diaspora/comments{/number}","issue_comment_url":"https://api.github.com/repos/diaspora/diaspora/issues/comments{/number}","contents_url":"https://api.github.com/repos/diaspora/diaspora/contents/{+path}","compare_url":"https://api.github.com/repos/diaspora/diaspora/compare/{base}...{head}","merges_url":"https://api.github.com/repos/diaspora/diaspora/merges","archive_url":"https://api.github.com/repos/diaspora/diaspora/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/diaspora/diaspora/downloads","issues_url":"https://api.github.com/repos/diaspora/diaspora/issues{/number}","pulls_url":"https://api.github.com/repos/diaspora/diaspora/pulls{/number}","milestones_url":"https://api.github.com/repos/diaspora/diaspora/milestones{/number}","notifications_url":"https://api.github.com/repos/diaspora/diaspora/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/diaspora/diaspora/labels{/name}","releases_url":"https://api.github.com/repos/diaspora/diaspora/releases{/id}","created_at":"2010-09-15T05:20:04Z","updated_at":"2015-07-11T04:51:42Z","pushed_at":"2015-07-11T06:48:46Z","git_url":"git://github.com/diaspora/diaspora.git","ssh_url":"git@github.com:diaspora/diaspora.git","clone_url":"https://github.com/diaspora/diaspora.git","svn_url":"https://github.com/diaspora/diaspora","homepage":"https://diasporafoundation.org/","size":252739,"stargazers_count":10145,"watchers_count":10145,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2618,"mirror_url":null,"open_issues_count":414,"forks":2618,"open_issues":414,"watchers":10145,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/diaspora/diaspora/pulls/6095"},"html":{"href":"https://github.com/diaspora/diaspora/pull/6095"},"issue":{"href":"https://api.github.com/repos/diaspora/diaspora/issues/6095"},"comments":{"href":"https://api.github.com/repos/diaspora/diaspora/issues/6095/comments"},"review_comments":{"href":"https://api.github.com/repos/diaspora/diaspora/pulls/6095/comments"},"review_comment":{"href":"https://api.github.com/repos/diaspora/diaspora/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/diaspora/diaspora/pulls/6095/commits"},"statuses":{"href":"https://api.github.com/repos/diaspora/diaspora/statuses/0b3d9d40fd7f724054752c1c3e8b06dc829ec0c6"}}}}