{"action":"created","comment":{"url":"https://api.github.com/repos/Jasig/cas/pulls/comments/61832791","id":61832791,"diff_hunk":"@@ -105,30 +122,50 @@ public ModelAndView handleRequestInternal(final HttpServletRequest request, fina\n         return redirectToApproveView(registeredService, context);\n     }\n \n-    private String buildCallbackUrlForImplicitResponseType(final String state, final Authentication authentication, \n-                                                             final Service service, final String redirectUri) {\n-        final AccessToken accessToken = generateAccessToken(service, authentication);\n+    private String buildCallbackUrlForImplicitResponseType(final J2EContext context,\n+                                                           final Authentication authentication,\n+                                                           final Service service,\n+                                                           final String redirectUri) {\n+\n+        final String state = authentication.getAttributes().get(OAuthConstants.STATE).toString();\n+        final String nonce = authentication.getAttributes().get(OAuthConstants.NONCE).toString();\n+        \n+        final AccessToken accessToken = generateAccessToken(service, authentication, context);\n         logger.debug(\"Generated Oauth access token: {}\", accessToken);\n \n         String callbackUrl = redirectUri;\n-        callbackUrl += \"#access_token=\" + accessToken.getId() + \"&token_type=bearer&expires_in=\" + this.timeout;\n-        if (state != null) {\n-            callbackUrl += \"&state=\" + EncodingUtils.urlEncode(state);","path":"cas-server-support-oauth/src/main/java/org/jasig/cas/support/oauth/web/OAuth20AuthorizeController.java","position":131,"original_position":131,"commit_id":"6c20a1c3dea06f071a0a0840c61df1af51d38b0a","original_commit_id":"6c20a1c3dea06f071a0a0840c61df1af51d38b0a","user":{"login":"mmoayyed","id":1205228,"avatar_url":"https://avatars.githubusercontent.com/u/1205228?v=3","gravatar_id":"","url":"https://api.github.com/users/mmoayyed","html_url":"https://github.com/mmoayyed","followers_url":"https://api.github.com/users/mmoayyed/followers","following_url":"https://api.github.com/users/mmoayyed/following{/other_user}","gists_url":"https://api.github.com/users/mmoayyed/gists{/gist_id}","starred_url":"https://api.github.com/users/mmoayyed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmoayyed/subscriptions","organizations_url":"https://api.github.com/users/mmoayyed/orgs","repos_url":"https://api.github.com/users/mmoayyed/repos","events_url":"https://api.github.com/users/mmoayyed/events{/privacy}","received_events_url":"https://api.github.com/users/mmoayyed/received_events","type":"User","site_admin":false},"body":"![Codacy](https://www.codacy.com/assets/images/favicon.png) Issue found: [Prefer StringBuffer over += for concatenating strings](https://www.codacy.com/app/mmoayyed/cas/file/2503633496/issues/source?bid=3256115&fileBranchId=3273836#l137)","created_at":"2016-05-03T02:24:24Z","updated_at":"2016-05-03T02:24:24Z","html_url":"https://github.com/Jasig/cas/pull/1733#discussion_r61832791","pull_request_url":"https://api.github.com/repos/Jasig/cas/pulls/1733","_links":{"self":{"href":"https://api.github.com/repos/Jasig/cas/pulls/comments/61832791"},"html":{"href":"https://github.com/Jasig/cas/pull/1733#discussion_r61832791"},"pull_request":{"href":"https://api.github.com/repos/Jasig/cas/pulls/1733"}}},"pull_request":{"url":"https://api.github.com/repos/Jasig/cas/pulls/1733","id":68649793,"html_url":"https://github.com/Jasig/cas/pull/1733","diff_url":"https://github.com/Jasig/cas/pull/1733.diff","patch_url":"https://github.com/Jasig/cas/pull/1733.patch","issue_url":"https://api.github.com/repos/Jasig/cas/issues/1733","number":1733,"state":"open","locked":false,"title":"Provide support for OIDC","user":{"login":"mmoayyed","id":1205228,"avatar_url":"https://avatars.githubusercontent.com/u/1205228?v=3","gravatar_id":"","url":"https://api.github.com/users/mmoayyed","html_url":"https://github.com/mmoayyed","followers_url":"https://api.github.com/users/mmoayyed/followers","following_url":"https://api.github.com/users/mmoayyed/following{/other_user}","gists_url":"https://api.github.com/users/mmoayyed/gists{/gist_id}","starred_url":"https://api.github.com/users/mmoayyed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmoayyed/subscriptions","organizations_url":"https://api.github.com/users/mmoayyed/orgs","repos_url":"https://api.github.com/users/mmoayyed/repos","events_url":"https://api.github.com/users/mmoayyed/events{/privacy}","received_events_url":"https://api.github.com/users/mmoayyed/received_events","type":"User","site_admin":false},"body":"Closes #514 \r\n\r\nThis is CAS supporting OpenID Connect. Built on top of the OAuth module by the excellent work that @leleuj had done in the past, which made doing this very very easy. \r\n\r\nEndpoints supported are:\r\n\r\n```\r\n- /cas/oidc/.well-known \r\n- /cas/oidc/.well-known/openid-configuration\r\n- /cas/oidc/authorize *\r\n- /cas/oidc/profile *\r\n- /cas/oidc/jwks\r\n- /cas/oidc/accessToken *\r\n```\r\n\r\nThose that are marked with an (*) are endpoints remapped to the OAuth endpoints. \r\n\r\nClients are added as such:\r\n\r\n```json\r\n{\r\n  \"@class\" : \"org.jasig.cas.services.OidcRegisteredService\",\r\n  \"clientId\": \"client\",\r\n  \"clientSecret\": \"secret\",\r\n  \"serviceId\" : \"^<https://the-redirect-uri>\",\r\n  \"signIdToken\": true,\r\n  \"jwks\": \"...\"\r\n}\r\n``` \r\n\r\nThis is a subset of the specification with basic support for OIDC. The following behaviors are not yet supported and can be added later:\r\n\r\n- OIDC extensions such as prompt and max_age\r\n- Encrypted ID Tokens\r\n\r\nI will be working on the test cases and other checks to make sure the PR is solid.  This batch has been tested against the MitreId's simple webapp client. ","created_at":"2016-05-03T02:15:52Z","updated_at":"2016-05-03T02:24:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"599ca6a08a017f6e54640cf4573836d3c60334dc","assignee":null,"milestone":{"url":"https://api.github.com/repos/Jasig/cas/milestones/15","html_url":"https://github.com/Jasig/cas/milestones/5.0.0","labels_url":"https://api.github.com/repos/Jasig/cas/milestones/15/labels","id":1349862,"number":15,"title":"5.0.0","description":"CAS version 5.0.0 release","creator":{"login":"mmoayyed","id":1205228,"avatar_url":"https://avatars.githubusercontent.com/u/1205228?v=3","gravatar_id":"","url":"https://api.github.com/users/mmoayyed","html_url":"https://github.com/mmoayyed","followers_url":"https://api.github.com/users/mmoayyed/followers","following_url":"https://api.github.com/users/mmoayyed/following{/other_user}","gists_url":"https://api.github.com/users/mmoayyed/gists{/gist_id}","starred_url":"https://api.github.com/users/mmoayyed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmoayyed/subscriptions","organizations_url":"https://api.github.com/users/mmoayyed/orgs","repos_url":"https://api.github.com/users/mmoayyed/repos","events_url":"https://api.github.com/users/mmoayyed/events{/privacy}","received_events_url":"https://api.github.com/users/mmoayyed/received_events","type":"User","site_admin":false},"open_issues":19,"closed_issues":177,"state":"open","created_at":"2015-10-12T01:28:38Z","updated_at":"2016-05-03T02:15:52Z","due_on":"2016-07-20T07:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/Jasig/cas/pulls/1733/commits","review_comments_url":"https://api.github.com/repos/Jasig/cas/pulls/1733/comments","review_comment_url":"https://api.github.com/repos/Jasig/cas/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Jasig/cas/issues/1733/comments","statuses_url":"https://api.github.com/repos/Jasig/cas/statuses/6c20a1c3dea06f071a0a0840c61df1af51d38b0a","head":{"label":"Unicon:oidc","ref":"oidc","sha":"6c20a1c3dea06f071a0a0840c61df1af51d38b0a","user":{"login":"Unicon","id":835400,"avatar_url":"https://avatars.githubusercontent.com/u/835400?v=3","gravatar_id":"","url":"https://api.github.com/users/Unicon","html_url":"https://github.com/Unicon","followers_url":"https://api.github.com/users/Unicon/followers","following_url":"https://api.github.com/users/Unicon/following{/other_user}","gists_url":"https://api.github.com/users/Unicon/gists{/gist_id}","starred_url":"https://api.github.com/users/Unicon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Unicon/subscriptions","organizations_url":"https://api.github.com/users/Unicon/orgs","repos_url":"https://api.github.com/users/Unicon/repos","events_url":"https://api.github.com/users/Unicon/events{/privacy}","received_events_url":"https://api.github.com/users/Unicon/received_events","type":"Organization","site_admin":false},"repo":{"id":6410069,"name":"cas","full_name":"Unicon/cas","owner":{"login":"Unicon","id":835400,"avatar_url":"https://avatars.githubusercontent.com/u/835400?v=3","gravatar_id":"","url":"https://api.github.com/users/Unicon","html_url":"https://github.com/Unicon","followers_url":"https://api.github.com/users/Unicon/followers","following_url":"https://api.github.com/users/Unicon/following{/other_user}","gists_url":"https://api.github.com/users/Unicon/gists{/gist_id}","starred_url":"https://api.github.com/users/Unicon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Unicon/subscriptions","organizations_url":"https://api.github.com/users/Unicon/orgs","repos_url":"https://api.github.com/users/Unicon/repos","events_url":"https://api.github.com/users/Unicon/events{/privacy}","received_events_url":"https://api.github.com/users/Unicon/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Unicon/cas","description":"Jasig CAS - Single Sign On for the Web","fork":true,"url":"https://api.github.com/repos/Unicon/cas","forks_url":"https://api.github.com/repos/Unicon/cas/forks","keys_url":"https://api.github.com/repos/Unicon/cas/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Unicon/cas/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Unicon/cas/teams","hooks_url":"https://api.github.com/repos/Unicon/cas/hooks","issue_events_url":"https://api.github.com/repos/Unicon/cas/issues/events{/number}","events_url":"https://api.github.com/repos/Unicon/cas/events","assignees_url":"https://api.github.com/repos/Unicon/cas/assignees{/user}","branches_url":"https://api.github.com/repos/Unicon/cas/branches{/branch}","tags_url":"https://api.github.com/repos/Unicon/cas/tags","blobs_url":"https://api.github.com/repos/Unicon/cas/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Unicon/cas/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Unicon/cas/git/refs{/sha}","trees_url":"https://api.github.com/repos/Unicon/cas/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Unicon/cas/statuses/{sha}","languages_url":"https://api.github.com/repos/Unicon/cas/languages","stargazers_url":"https://api.github.com/repos/Unicon/cas/stargazers","contributors_url":"https://api.github.com/repos/Unicon/cas/contributors","subscribers_url":"https://api.github.com/repos/Unicon/cas/subscribers","subscription_url":"https://api.github.com/repos/Unicon/cas/subscription","commits_url":"https://api.github.com/repos/Unicon/cas/commits{/sha}","git_commits_url":"https://api.github.com/repos/Unicon/cas/git/commits{/sha}","comments_url":"https://api.github.com/repos/Unicon/cas/comments{/number}","issue_comment_url":"https://api.github.com/repos/Unicon/cas/issues/comments{/number}","contents_url":"https://api.github.com/repos/Unicon/cas/contents/{+path}","compare_url":"https://api.github.com/repos/Unicon/cas/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Unicon/cas/merges","archive_url":"https://api.github.com/repos/Unicon/cas/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Unicon/cas/downloads","issues_url":"https://api.github.com/repos/Unicon/cas/issues{/number}","pulls_url":"https://api.github.com/repos/Unicon/cas/pulls{/number}","milestones_url":"https://api.github.com/repos/Unicon/cas/milestones{/number}","notifications_url":"https://api.github.com/repos/Unicon/cas/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Unicon/cas/labels{/name}","releases_url":"https://api.github.com/repos/Unicon/cas/releases{/id}","deployments_url":"https://api.github.com/repos/Unicon/cas/deployments","created_at":"2012-10-26T20:34:46Z","updated_at":"2015-11-25T01:55:15Z","pushed_at":"2016-05-03T02:08:40Z","git_url":"git://github.com/Unicon/cas.git","ssh_url":"git@github.com:Unicon/cas.git","clone_url":"https://github.com/Unicon/cas.git","svn_url":"https://github.com/Unicon/cas","homepage":"http://www.jasig.org/cas","size":44195,"stargazers_count":22,"watchers_count":22,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":24,"mirror_url":null,"open_issues_count":0,"forks":24,"open_issues":0,"watchers":22,"default_branch":"master"}},"base":{"label":"Jasig:master","ref":"master","sha":"ece1fc2652ea1ba0bc91d2911e3d3607135242c3","user":{"login":"Jasig","id":884285,"avatar_url":"https://avatars.githubusercontent.com/u/884285?v=3","gravatar_id":"","url":"https://api.github.com/users/Jasig","html_url":"https://github.com/Jasig","followers_url":"https://api.github.com/users/Jasig/followers","following_url":"https://api.github.com/users/Jasig/following{/other_user}","gists_url":"https://api.github.com/users/Jasig/gists{/gist_id}","starred_url":"https://api.github.com/users/Jasig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jasig/subscriptions","organizations_url":"https://api.github.com/users/Jasig/orgs","repos_url":"https://api.github.com/users/Jasig/repos","events_url":"https://api.github.com/users/Jasig/events{/privacy}","received_events_url":"https://api.github.com/users/Jasig/received_events","type":"Organization","site_admin":false},"repo":{"id":2352744,"name":"cas","full_name":"Jasig/cas","owner":{"login":"Jasig","id":884285,"avatar_url":"https://avatars.githubusercontent.com/u/884285?v=3","gravatar_id":"","url":"https://api.github.com/users/Jasig","html_url":"https://github.com/Jasig","followers_url":"https://api.github.com/users/Jasig/followers","following_url":"https://api.github.com/users/Jasig/following{/other_user}","gists_url":"https://api.github.com/users/Jasig/gists{/gist_id}","starred_url":"https://api.github.com/users/Jasig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jasig/subscriptions","organizations_url":"https://api.github.com/users/Jasig/orgs","repos_url":"https://api.github.com/users/Jasig/repos","events_url":"https://api.github.com/users/Jasig/events{/privacy}","received_events_url":"https://api.github.com/users/Jasig/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Jasig/cas","description":"Apereo CAS - Single Sign On for the Web","fork":false,"url":"https://api.github.com/repos/Jasig/cas","forks_url":"https://api.github.com/repos/Jasig/cas/forks","keys_url":"https://api.github.com/repos/Jasig/cas/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Jasig/cas/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Jasig/cas/teams","hooks_url":"https://api.github.com/repos/Jasig/cas/hooks","issue_events_url":"https://api.github.com/repos/Jasig/cas/issues/events{/number}","events_url":"https://api.github.com/repos/Jasig/cas/events","assignees_url":"https://api.github.com/repos/Jasig/cas/assignees{/user}","branches_url":"https://api.github.com/repos/Jasig/cas/branches{/branch}","tags_url":"https://api.github.com/repos/Jasig/cas/tags","blobs_url":"https://api.github.com/repos/Jasig/cas/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Jasig/cas/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Jasig/cas/git/refs{/sha}","trees_url":"https://api.github.com/repos/Jasig/cas/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Jasig/cas/statuses/{sha}","languages_url":"https://api.github.com/repos/Jasig/cas/languages","stargazers_url":"https://api.github.com/repos/Jasig/cas/stargazers","contributors_url":"https://api.github.com/repos/Jasig/cas/contributors","subscribers_url":"https://api.github.com/repos/Jasig/cas/subscribers","subscription_url":"https://api.github.com/repos/Jasig/cas/subscription","commits_url":"https://api.github.com/repos/Jasig/cas/commits{/sha}","git_commits_url":"https://api.github.com/repos/Jasig/cas/git/commits{/sha}","comments_url":"https://api.github.com/repos/Jasig/cas/comments{/number}","issue_comment_url":"https://api.github.com/repos/Jasig/cas/issues/comments{/number}","contents_url":"https://api.github.com/repos/Jasig/cas/contents/{+path}","compare_url":"https://api.github.com/repos/Jasig/cas/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Jasig/cas/merges","archive_url":"https://api.github.com/repos/Jasig/cas/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Jasig/cas/downloads","issues_url":"https://api.github.com/repos/Jasig/cas/issues{/number}","pulls_url":"https://api.github.com/repos/Jasig/cas/pulls{/number}","milestones_url":"https://api.github.com/repos/Jasig/cas/milestones{/number}","notifications_url":"https://api.github.com/repos/Jasig/cas/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Jasig/cas/labels{/name}","releases_url":"https://api.github.com/repos/Jasig/cas/releases{/id}","deployments_url":"https://api.github.com/repos/Jasig/cas/deployments","created_at":"2011-09-09T01:36:42Z","updated_at":"2016-05-02T21:43:42Z","pushed_at":"2016-05-03T02:15:52Z","git_url":"git://github.com/Jasig/cas.git","ssh_url":"git@github.com:Jasig/cas.git","clone_url":"https://github.com/Jasig/cas.git","svn_url":"https://github.com/Jasig/cas","homepage":"http://jasig.github.io/cas/","size":1072868,"stargazers_count":1330,"watchers_count":1330,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":963,"mirror_url":null,"open_issues_count":36,"forks":963,"open_issues":36,"watchers":1330,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Jasig/cas/pulls/1733"},"html":{"href":"https://github.com/Jasig/cas/pull/1733"},"issue":{"href":"https://api.github.com/repos/Jasig/cas/issues/1733"},"comments":{"href":"https://api.github.com/repos/Jasig/cas/issues/1733/comments"},"review_comments":{"href":"https://api.github.com/repos/Jasig/cas/pulls/1733/comments"},"review_comment":{"href":"https://api.github.com/repos/Jasig/cas/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Jasig/cas/pulls/1733/commits"},"statuses":{"href":"https://api.github.com/repos/Jasig/cas/statuses/6c20a1c3dea06f071a0a0840c61df1af51d38b0a"}}}}