{"action":"created","comment":{"url":"https://api.github.com/repos/apereo/cas/pulls/comments/70939472","id":70939472,"diff_hunk":"@@ -0,0 +1,70 @@\n+package org.apereo.cas.authentication;\n+\n+import java.security.MessageDigest;\n+import java.security.NoSuchAlgorithmException;\n+\n+import org.ldaptive.CompareOperation;\n+import org.ldaptive.CompareRequest;\n+import org.ldaptive.Connection;\n+import org.ldaptive.LdapAttribute;\n+import org.ldaptive.LdapException;\n+import org.ldaptive.LdapUtils;\n+import org.ldaptive.Response;\n+import org.ldaptive.auth.AuthenticationCriteria;\n+import org.ldaptive.auth.AuthenticationHandlerResponse;\n+import org.ldaptive.auth.PooledCompareAuthenticationHandler;\n+import org.ldaptive.pool.PooledConnectionFactory;\n+\n+public class PooledCompareCustomAttributeAuthenticationHandler extends\n+\t\tPooledCompareAuthenticationHandler {\n+\n+\tprotected static final String DEFAULT_PASSWORD_ATTRIBUTE_NAME = \"userPassword\";\n+\n+\tprivate String passwordAttributeName = DEFAULT_PASSWORD_ATTRIBUTE_NAME;\n+\t\n+\tpublic PooledCompareCustomAttributeAuthenticationHandler(PooledConnectionFactory cf) {\n+\t\tsuper(cf);\n+\t}\n+\n+\tpublic String getPasswordAttributeName() {\n+\t\treturn passwordAttributeName;\n+\t}\n+\n+\tpublic void setPasswordAttributeName(String passwordAttributeName) {\n+\t\tthis.passwordAttributeName = passwordAttributeName;\n+\t}\n+\n+\t/** {@inheritDoc} */\n+\t@Override\n+\t  protected AuthenticationHandlerResponse authenticateInternal(\n+\t    final Connection c,\n+\t    final AuthenticationCriteria criteria)\n+\t    throws LdapException\n+\t  {\n+\t    byte[] hash;\n+\t    try {","path":"cas-server-support-ldap/src/main/java/org/apereo/cas/authentication/PooledCompareCustomAttributeAuthenticationHandler.java","position":45,"original_position":45,"commit_id":"a2aac08a0af7812c48420297aa1236a9a88f1452","original_commit_id":"a2aac08a0af7812c48420297aa1236a9a88f1452","user":{"login":"codacy-bot","id":19940114,"avatar_url":"https://avatars.githubusercontent.com/u/19940114?v=3","gravatar_id":"","url":"https://api.github.com/users/codacy-bot","html_url":"https://github.com/codacy-bot","followers_url":"https://api.github.com/users/codacy-bot/followers","following_url":"https://api.github.com/users/codacy-bot/following{/other_user}","gists_url":"https://api.github.com/users/codacy-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/codacy-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codacy-bot/subscriptions","organizations_url":"https://api.github.com/users/codacy-bot/orgs","repos_url":"https://api.github.com/users/codacy-bot/repos","events_url":"https://api.github.com/users/codacy-bot/events{/privacy}","received_events_url":"https://api.github.com/users/codacy-bot/received_events","type":"User","site_admin":false},"body":"![Codacy](https://www.codacy.com/assets/images/favicon.png) Issue found: ['try' have incorrect indentation level 12, expected level should be 8.](https://www.codacy.com/app/mmoayyed/cas/file/3000846338/issues/source?bid=3256115&fileBranchId=3445415#l45)","created_at":"2016-07-15T08:40:48Z","updated_at":"2016-07-15T08:40:48Z","html_url":"https://github.com/apereo/cas/pull/1890#discussion_r70939472","pull_request_url":"https://api.github.com/repos/apereo/cas/pulls/1890","_links":{"self":{"href":"https://api.github.com/repos/apereo/cas/pulls/comments/70939472"},"html":{"href":"https://github.com/apereo/cas/pull/1890#discussion_r70939472"},"pull_request":{"href":"https://api.github.com/repos/apereo/cas/pulls/1890"}}},"pull_request":{"url":"https://api.github.com/repos/apereo/cas/pulls/1890","id":77581025,"html_url":"https://github.com/apereo/cas/pull/1890","diff_url":"https://github.com/apereo/cas/pull/1890.diff","patch_url":"https://github.com/apereo/cas/pull/1890.patch","issue_url":"https://api.github.com/repos/apereo/cas/issues/1890","number":1890,"state":"open","locked":false,"title":"LDAP improvement & bug fix","user":{"login":"rkorn86","id":3834907,"avatar_url":"https://avatars.githubusercontent.com/u/3834907?v=3","gravatar_id":"","url":"https://api.github.com/users/rkorn86","html_url":"https://github.com/rkorn86","followers_url":"https://api.github.com/users/rkorn86/followers","following_url":"https://api.github.com/users/rkorn86/following{/other_user}","gists_url":"https://api.github.com/users/rkorn86/gists{/gist_id}","starred_url":"https://api.github.com/users/rkorn86/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rkorn86/subscriptions","organizations_url":"https://api.github.com/users/rkorn86/orgs","repos_url":"https://api.github.com/users/rkorn86/repos","events_url":"https://api.github.com/users/rkorn86/events{/privacy}","received_events_url":"https://api.github.com/users/rkorn86/received_events","type":"User","site_admin":false},"body":"The following PR addresses some LDAP bugs and improvements.\r\n\r\n1. Compare custom user password LDAP-Attribute  \r\n  1.1 New property `cas.authn.ldap[0].principalAttributePassword` which is by default  set to `userPassword`  \r\n   1.2 sidde effect: `AUTHENTICATED` and `ANONYMOUS` ldap authentication tries dont use `PooledBindAuthenticationHandler` anymore, but compare LDAP-PasswordAttribute (which needs be readable via ACL of course)\r\n2. Fix LDAP connection Pool not initialized error\r\n3. Initialize LdapAuthenticationHandler correctly\r\n\r\nEnsure that you include the following:\r\n\r\n- [x] Brief description of changes applied\r\n- [x] Any documentation on how to configure, test\r\n- [x] Any possible limitations, side effects, etc\r\n- [x] Reference any other pull requests that might be related.\r\n- [x] I have signed the Apereo ICLA form, located here: https://www.apereo.org/licensing/agreements/icla\r\n\r\n<!--\r\nThanks for your contribution. \r\n-->\r\n","created_at":"2016-07-15T08:34:09Z","updated_at":"2016-07-15T08:40:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7859a45e4e66933c34e34bc20a62c3d5d1200004","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/apereo/cas/pulls/1890/commits","review_comments_url":"https://api.github.com/repos/apereo/cas/pulls/1890/comments","review_comment_url":"https://api.github.com/repos/apereo/cas/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apereo/cas/issues/1890/comments","statuses_url":"https://api.github.com/repos/apereo/cas/statuses/a2aac08a0af7812c48420297aa1236a9a88f1452","head":{"label":"rkorn86:master","ref":"master","sha":"a2aac08a0af7812c48420297aa1236a9a88f1452","user":{"login":"rkorn86","id":3834907,"avatar_url":"https://avatars.githubusercontent.com/u/3834907?v=3","gravatar_id":"","url":"https://api.github.com/users/rkorn86","html_url":"https://github.com/rkorn86","followers_url":"https://api.github.com/users/rkorn86/followers","following_url":"https://api.github.com/users/rkorn86/following{/other_user}","gists_url":"https://api.github.com/users/rkorn86/gists{/gist_id}","starred_url":"https://api.github.com/users/rkorn86/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rkorn86/subscriptions","organizations_url":"https://api.github.com/users/rkorn86/orgs","repos_url":"https://api.github.com/users/rkorn86/repos","events_url":"https://api.github.com/users/rkorn86/events{/privacy}","received_events_url":"https://api.github.com/users/rkorn86/received_events","type":"User","site_admin":false},"repo":{"id":44962359,"name":"cas","full_name":"rkorn86/cas","owner":{"login":"rkorn86","id":3834907,"avatar_url":"https://avatars.githubusercontent.com/u/3834907?v=3","gravatar_id":"","url":"https://api.github.com/users/rkorn86","html_url":"https://github.com/rkorn86","followers_url":"https://api.github.com/users/rkorn86/followers","following_url":"https://api.github.com/users/rkorn86/following{/other_user}","gists_url":"https://api.github.com/users/rkorn86/gists{/gist_id}","starred_url":"https://api.github.com/users/rkorn86/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rkorn86/subscriptions","organizations_url":"https://api.github.com/users/rkorn86/orgs","repos_url":"https://api.github.com/users/rkorn86/repos","events_url":"https://api.github.com/users/rkorn86/events{/privacy}","received_events_url":"https://api.github.com/users/rkorn86/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rkorn86/cas","description":"Apereo CAS - Single Sign On for the Web","fork":true,"url":"https://api.github.com/repos/rkorn86/cas","forks_url":"https://api.github.com/repos/rkorn86/cas/forks","keys_url":"https://api.github.com/repos/rkorn86/cas/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rkorn86/cas/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rkorn86/cas/teams","hooks_url":"https://api.github.com/repos/rkorn86/cas/hooks","issue_events_url":"https://api.github.com/repos/rkorn86/cas/issues/events{/number}","events_url":"https://api.github.com/repos/rkorn86/cas/events","assignees_url":"https://api.github.com/repos/rkorn86/cas/assignees{/user}","branches_url":"https://api.github.com/repos/rkorn86/cas/branches{/branch}","tags_url":"https://api.github.com/repos/rkorn86/cas/tags","blobs_url":"https://api.github.com/repos/rkorn86/cas/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rkorn86/cas/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rkorn86/cas/git/refs{/sha}","trees_url":"https://api.github.com/repos/rkorn86/cas/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rkorn86/cas/statuses/{sha}","languages_url":"https://api.github.com/repos/rkorn86/cas/languages","stargazers_url":"https://api.github.com/repos/rkorn86/cas/stargazers","contributors_url":"https://api.github.com/repos/rkorn86/cas/contributors","subscribers_url":"https://api.github.com/repos/rkorn86/cas/subscribers","subscription_url":"https://api.github.com/repos/rkorn86/cas/subscription","commits_url":"https://api.github.com/repos/rkorn86/cas/commits{/sha}","git_commits_url":"https://api.github.com/repos/rkorn86/cas/git/commits{/sha}","comments_url":"https://api.github.com/repos/rkorn86/cas/comments{/number}","issue_comment_url":"https://api.github.com/repos/rkorn86/cas/issues/comments{/number}","contents_url":"https://api.github.com/repos/rkorn86/cas/contents/{+path}","compare_url":"https://api.github.com/repos/rkorn86/cas/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rkorn86/cas/merges","archive_url":"https://api.github.com/repos/rkorn86/cas/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rkorn86/cas/downloads","issues_url":"https://api.github.com/repos/rkorn86/cas/issues{/number}","pulls_url":"https://api.github.com/repos/rkorn86/cas/pulls{/number}","milestones_url":"https://api.github.com/repos/rkorn86/cas/milestones{/number}","notifications_url":"https://api.github.com/repos/rkorn86/cas/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rkorn86/cas/labels{/name}","releases_url":"https://api.github.com/repos/rkorn86/cas/releases{/id}","deployments_url":"https://api.github.com/repos/rkorn86/cas/deployments","created_at":"2015-10-26T10:48:38Z","updated_at":"2016-04-21T13:06:23Z","pushed_at":"2016-07-15T08:23:45Z","git_url":"git://github.com/rkorn86/cas.git","ssh_url":"git@github.com:rkorn86/cas.git","clone_url":"https://github.com/rkorn86/cas.git","svn_url":"https://github.com/rkorn86/cas","homepage":"http://jasig.github.io/cas/","size":656943,"stargazers_count":0,"watchers_count":0,"language":"Java","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":"master"}},"base":{"label":"apereo:master","ref":"master","sha":"c6c53b013df632669473d3644bf02d7a9c4380c0","user":{"login":"apereo","id":4679233,"avatar_url":"https://avatars.githubusercontent.com/u/4679233?v=3","gravatar_id":"","url":"https://api.github.com/users/apereo","html_url":"https://github.com/apereo","followers_url":"https://api.github.com/users/apereo/followers","following_url":"https://api.github.com/users/apereo/following{/other_user}","gists_url":"https://api.github.com/users/apereo/gists{/gist_id}","starred_url":"https://api.github.com/users/apereo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apereo/subscriptions","organizations_url":"https://api.github.com/users/apereo/orgs","repos_url":"https://api.github.com/users/apereo/repos","events_url":"https://api.github.com/users/apereo/events{/privacy}","received_events_url":"https://api.github.com/users/apereo/received_events","type":"Organization","site_admin":false},"repo":{"id":2352744,"name":"cas","full_name":"apereo/cas","owner":{"login":"apereo","id":4679233,"avatar_url":"https://avatars.githubusercontent.com/u/4679233?v=3","gravatar_id":"","url":"https://api.github.com/users/apereo","html_url":"https://github.com/apereo","followers_url":"https://api.github.com/users/apereo/followers","following_url":"https://api.github.com/users/apereo/following{/other_user}","gists_url":"https://api.github.com/users/apereo/gists{/gist_id}","starred_url":"https://api.github.com/users/apereo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apereo/subscriptions","organizations_url":"https://api.github.com/users/apereo/orgs","repos_url":"https://api.github.com/users/apereo/repos","events_url":"https://api.github.com/users/apereo/events{/privacy}","received_events_url":"https://api.github.com/users/apereo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apereo/cas","description":"Apereo CAS - Enterprise Single Sign On for all","fork":false,"url":"https://api.github.com/repos/apereo/cas","forks_url":"https://api.github.com/repos/apereo/cas/forks","keys_url":"https://api.github.com/repos/apereo/cas/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apereo/cas/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apereo/cas/teams","hooks_url":"https://api.github.com/repos/apereo/cas/hooks","issue_events_url":"https://api.github.com/repos/apereo/cas/issues/events{/number}","events_url":"https://api.github.com/repos/apereo/cas/events","assignees_url":"https://api.github.com/repos/apereo/cas/assignees{/user}","branches_url":"https://api.github.com/repos/apereo/cas/branches{/branch}","tags_url":"https://api.github.com/repos/apereo/cas/tags","blobs_url":"https://api.github.com/repos/apereo/cas/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apereo/cas/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apereo/cas/git/refs{/sha}","trees_url":"https://api.github.com/repos/apereo/cas/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apereo/cas/statuses/{sha}","languages_url":"https://api.github.com/repos/apereo/cas/languages","stargazers_url":"https://api.github.com/repos/apereo/cas/stargazers","contributors_url":"https://api.github.com/repos/apereo/cas/contributors","subscribers_url":"https://api.github.com/repos/apereo/cas/subscribers","subscription_url":"https://api.github.com/repos/apereo/cas/subscription","commits_url":"https://api.github.com/repos/apereo/cas/commits{/sha}","git_commits_url":"https://api.github.com/repos/apereo/cas/git/commits{/sha}","comments_url":"https://api.github.com/repos/apereo/cas/comments{/number}","issue_comment_url":"https://api.github.com/repos/apereo/cas/issues/comments{/number}","contents_url":"https://api.github.com/repos/apereo/cas/contents/{+path}","compare_url":"https://api.github.com/repos/apereo/cas/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apereo/cas/merges","archive_url":"https://api.github.com/repos/apereo/cas/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apereo/cas/downloads","issues_url":"https://api.github.com/repos/apereo/cas/issues{/number}","pulls_url":"https://api.github.com/repos/apereo/cas/pulls{/number}","milestones_url":"https://api.github.com/repos/apereo/cas/milestones{/number}","notifications_url":"https://api.github.com/repos/apereo/cas/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apereo/cas/labels{/name}","releases_url":"https://api.github.com/repos/apereo/cas/releases{/id}","deployments_url":"https://api.github.com/repos/apereo/cas/deployments","created_at":"2011-09-09T01:36:42Z","updated_at":"2016-07-15T06:56:22Z","pushed_at":"2016-07-15T08:34:10Z","git_url":"git://github.com/apereo/cas.git","ssh_url":"git@github.com:apereo/cas.git","clone_url":"https://github.com/apereo/cas.git","svn_url":"https://github.com/apereo/cas","homepage":"https://apereo.github.io/cas/","size":1251323,"stargazers_count":1560,"watchers_count":1560,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":1084,"mirror_url":null,"open_issues_count":32,"forks":1084,"open_issues":32,"watchers":1560,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apereo/cas/pulls/1890"},"html":{"href":"https://github.com/apereo/cas/pull/1890"},"issue":{"href":"https://api.github.com/repos/apereo/cas/issues/1890"},"comments":{"href":"https://api.github.com/repos/apereo/cas/issues/1890/comments"},"review_comments":{"href":"https://api.github.com/repos/apereo/cas/pulls/1890/comments"},"review_comment":{"href":"https://api.github.com/repos/apereo/cas/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apereo/cas/pulls/1890/commits"},"statuses":{"href":"https://api.github.com/repos/apereo/cas/statuses/a2aac08a0af7812c48420297aa1236a9a88f1452"}}}}
{"actor":{"display_login":"codacy-bot"}}