{"action":"created","comment":{"url":"https://api.github.com/repos/pac4j/pac4j/pulls/comments/57838637","id":57838637,"diff_hunk":"@@ -43,20 +44,36 @@ private void generateAuth(final U profile, final String[] attributes, final bool\n         if (attributes != null) {\n             for (final String attribute : attributes) {\n                 final Object value = profile.getAttribute(attribute);\n-                if (value != null && value instanceof String) {\n-                    final StringTokenizer st = new StringTokenizer((String) value, this.splitChar);\n-                    while (st.hasMoreTokens()) {\n-                        if (isRole) {\n-                            profile.addRole(st.nextToken());\n-                        } else {\n-                            profile.addPermission(st.nextToken());\n+                if (value != null) {\n+                    if(value instanceof String) {\n+                        final StringTokenizer st = new StringTokenizer((String) value, this.splitChar);\n+                        while (st.hasMoreTokens()) {\n+                            setAuth(profile, st.nextToken(), isRole);\n+                        }\n+                    } else if(value.getClass().isArray() && value.getClass().getComponentType().isAssignableFrom(String.class)) {","path":"pac4j-core/src/main/java/org/pac4j/core/authorization/generator/FromAttributesAuthorizationGenerator.java","position":25,"original_position":25,"commit_id":"8ad89468f5a8133188fde1d0eb5243f6d3a755ba","original_commit_id":"8ad89468f5a8133188fde1d0eb5243f6d3a755ba","user":{"login":"leleuj","id":1038508,"avatar_url":"https://avatars.githubusercontent.com/u/1038508?v=3","gravatar_id":"","url":"https://api.github.com/users/leleuj","html_url":"https://github.com/leleuj","followers_url":"https://api.github.com/users/leleuj/followers","following_url":"https://api.github.com/users/leleuj/following{/other_user}","gists_url":"https://api.github.com/users/leleuj/gists{/gist_id}","starred_url":"https://api.github.com/users/leleuj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leleuj/subscriptions","organizations_url":"https://api.github.com/users/leleuj/orgs","repos_url":"https://api.github.com/users/leleuj/repos","events_url":"https://api.github.com/users/leleuj/events{/privacy}","received_events_url":"https://api.github.com/users/leleuj/received_events","type":"User","site_admin":false},"body":"I think we could even remove the test to check that elements are String.","created_at":"2016-03-30T05:31:36Z","updated_at":"2016-03-30T05:31:36Z","html_url":"https://github.com/pac4j/pac4j/pull/532#discussion_r57838637","pull_request_url":"https://api.github.com/repos/pac4j/pac4j/pulls/532","_links":{"self":{"href":"https://api.github.com/repos/pac4j/pac4j/pulls/comments/57838637"},"html":{"href":"https://github.com/pac4j/pac4j/pull/532#discussion_r57838637"},"pull_request":{"href":"https://api.github.com/repos/pac4j/pac4j/pulls/532"}}},"pull_request":{"url":"https://api.github.com/repos/pac4j/pac4j/pulls/532","id":64488799,"html_url":"https://github.com/pac4j/pac4j/pull/532","diff_url":"https://github.com/pac4j/pac4j/pull/532.diff","patch_url":"https://github.com/pac4j/pac4j/pull/532.patch","issue_url":"https://api.github.com/repos/pac4j/pac4j/issues/532","number":532,"state":"open","locked":false,"title":"Ability to load roles from a list value as well as strings.","user":{"login":"ikogan","id":1840337,"avatar_url":"https://avatars.githubusercontent.com/u/1840337?v=3","gravatar_id":"","url":"https://api.github.com/users/ikogan","html_url":"https://github.com/ikogan","followers_url":"https://api.github.com/users/ikogan/followers","following_url":"https://api.github.com/users/ikogan/following{/other_user}","gists_url":"https://api.github.com/users/ikogan/gists{/gist_id}","starred_url":"https://api.github.com/users/ikogan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ikogan/subscriptions","organizations_url":"https://api.github.com/users/ikogan/orgs","repos_url":"https://api.github.com/users/ikogan/repos","events_url":"https://api.github.com/users/ikogan/events{/privacy}","received_events_url":"https://api.github.com/users/ikogan/received_events","type":"User","site_admin":false},"body":"Currently, `FromAttributesAuthorizationGenerator` only loads roles from string attributes with a comma separated list of roles. Sometimes, service (notably CAS), return roles as a list (notably `memberOf` from LDAP). This allows attribute values to be lists or arrays.","created_at":"2016-03-29T15:55:14Z","updated_at":"2016-03-30T05:31:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7863ef67bbe9018cfc7be40ba77dd4efea449a15","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/pac4j/pac4j/pulls/532/commits","review_comments_url":"https://api.github.com/repos/pac4j/pac4j/pulls/532/comments","review_comment_url":"https://api.github.com/repos/pac4j/pac4j/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pac4j/pac4j/issues/532/comments","statuses_url":"https://api.github.com/repos/pac4j/pac4j/statuses/8ad89468f5a8133188fde1d0eb5243f6d3a755ba","head":{"label":"ohioit:Roles-From-Attribute-List","ref":"Roles-From-Attribute-List","sha":"8ad89468f5a8133188fde1d0eb5243f6d3a755ba","user":{"login":"ohioit","id":17324559,"avatar_url":"https://avatars.githubusercontent.com/u/17324559?v=3","gravatar_id":"","url":"https://api.github.com/users/ohioit","html_url":"https://github.com/ohioit","followers_url":"https://api.github.com/users/ohioit/followers","following_url":"https://api.github.com/users/ohioit/following{/other_user}","gists_url":"https://api.github.com/users/ohioit/gists{/gist_id}","starred_url":"https://api.github.com/users/ohioit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ohioit/subscriptions","organizations_url":"https://api.github.com/users/ohioit/orgs","repos_url":"https://api.github.com/users/ohioit/repos","events_url":"https://api.github.com/users/ohioit/events{/privacy}","received_events_url":"https://api.github.com/users/ohioit/received_events","type":"Organization","site_admin":false},"repo":{"id":54985464,"name":"pac4j","full_name":"ohioit/pac4j","owner":{"login":"ohioit","id":17324559,"avatar_url":"https://avatars.githubusercontent.com/u/17324559?v=3","gravatar_id":"","url":"https://api.github.com/users/ohioit","html_url":"https://github.com/ohioit","followers_url":"https://api.github.com/users/ohioit/followers","following_url":"https://api.github.com/users/ohioit/following{/other_user}","gists_url":"https://api.github.com/users/ohioit/gists{/gist_id}","starred_url":"https://api.github.com/users/ohioit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ohioit/subscriptions","organizations_url":"https://api.github.com/users/ohioit/orgs","repos_url":"https://api.github.com/users/ohioit/repos","events_url":"https://api.github.com/users/ohioit/events{/privacy}","received_events_url":"https://api.github.com/users/ohioit/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ohioit/pac4j","description":"Security engine for Java (authentication, authorization, multi frameworks)","fork":true,"url":"https://api.github.com/repos/ohioit/pac4j","forks_url":"https://api.github.com/repos/ohioit/pac4j/forks","keys_url":"https://api.github.com/repos/ohioit/pac4j/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ohioit/pac4j/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ohioit/pac4j/teams","hooks_url":"https://api.github.com/repos/ohioit/pac4j/hooks","issue_events_url":"https://api.github.com/repos/ohioit/pac4j/issues/events{/number}","events_url":"https://api.github.com/repos/ohioit/pac4j/events","assignees_url":"https://api.github.com/repos/ohioit/pac4j/assignees{/user}","branches_url":"https://api.github.com/repos/ohioit/pac4j/branches{/branch}","tags_url":"https://api.github.com/repos/ohioit/pac4j/tags","blobs_url":"https://api.github.com/repos/ohioit/pac4j/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ohioit/pac4j/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ohioit/pac4j/git/refs{/sha}","trees_url":"https://api.github.com/repos/ohioit/pac4j/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ohioit/pac4j/statuses/{sha}","languages_url":"https://api.github.com/repos/ohioit/pac4j/languages","stargazers_url":"https://api.github.com/repos/ohioit/pac4j/stargazers","contributors_url":"https://api.github.com/repos/ohioit/pac4j/contributors","subscribers_url":"https://api.github.com/repos/ohioit/pac4j/subscribers","subscription_url":"https://api.github.com/repos/ohioit/pac4j/subscription","commits_url":"https://api.github.com/repos/ohioit/pac4j/commits{/sha}","git_commits_url":"https://api.github.com/repos/ohioit/pac4j/git/commits{/sha}","comments_url":"https://api.github.com/repos/ohioit/pac4j/comments{/number}","issue_comment_url":"https://api.github.com/repos/ohioit/pac4j/issues/comments{/number}","contents_url":"https://api.github.com/repos/ohioit/pac4j/contents/{+path}","compare_url":"https://api.github.com/repos/ohioit/pac4j/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ohioit/pac4j/merges","archive_url":"https://api.github.com/repos/ohioit/pac4j/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ohioit/pac4j/downloads","issues_url":"https://api.github.com/repos/ohioit/pac4j/issues{/number}","pulls_url":"https://api.github.com/repos/ohioit/pac4j/pulls{/number}","milestones_url":"https://api.github.com/repos/ohioit/pac4j/milestones{/number}","notifications_url":"https://api.github.com/repos/ohioit/pac4j/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ohioit/pac4j/labels{/name}","releases_url":"https://api.github.com/repos/ohioit/pac4j/releases{/id}","deployments_url":"https://api.github.com/repos/ohioit/pac4j/deployments","created_at":"2016-03-29T15:03:01Z","updated_at":"2016-03-29T15:03:03Z","pushed_at":"2016-03-29T17:00:35Z","git_url":"git://github.com/ohioit/pac4j.git","ssh_url":"git@github.com:ohioit/pac4j.git","clone_url":"https://github.com/ohioit/pac4j.git","svn_url":"https://github.com/ohioit/pac4j","homepage":"http://www.pac4j.org","size":24361,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"pac4j:master","ref":"master","sha":"68b1a75f3aca0c0e005dc12a9a2aa936da44765a","user":{"login":"pac4j","id":7540865,"avatar_url":"https://avatars.githubusercontent.com/u/7540865?v=3","gravatar_id":"","url":"https://api.github.com/users/pac4j","html_url":"https://github.com/pac4j","followers_url":"https://api.github.com/users/pac4j/followers","following_url":"https://api.github.com/users/pac4j/following{/other_user}","gists_url":"https://api.github.com/users/pac4j/gists{/gist_id}","starred_url":"https://api.github.com/users/pac4j/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pac4j/subscriptions","organizations_url":"https://api.github.com/users/pac4j/orgs","repos_url":"https://api.github.com/users/pac4j/repos","events_url":"https://api.github.com/users/pac4j/events{/privacy}","received_events_url":"https://api.github.com/users/pac4j/received_events","type":"Organization","site_admin":false},"repo":{"id":3291848,"name":"pac4j","full_name":"pac4j/pac4j","owner":{"login":"pac4j","id":7540865,"avatar_url":"https://avatars.githubusercontent.com/u/7540865?v=3","gravatar_id":"","url":"https://api.github.com/users/pac4j","html_url":"https://github.com/pac4j","followers_url":"https://api.github.com/users/pac4j/followers","following_url":"https://api.github.com/users/pac4j/following{/other_user}","gists_url":"https://api.github.com/users/pac4j/gists{/gist_id}","starred_url":"https://api.github.com/users/pac4j/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pac4j/subscriptions","organizations_url":"https://api.github.com/users/pac4j/orgs","repos_url":"https://api.github.com/users/pac4j/repos","events_url":"https://api.github.com/users/pac4j/events{/privacy}","received_events_url":"https://api.github.com/users/pac4j/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pac4j/pac4j","description":"Security engine for Java (authentication, authorization, multi frameworks)","fork":false,"url":"https://api.github.com/repos/pac4j/pac4j","forks_url":"https://api.github.com/repos/pac4j/pac4j/forks","keys_url":"https://api.github.com/repos/pac4j/pac4j/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pac4j/pac4j/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pac4j/pac4j/teams","hooks_url":"https://api.github.com/repos/pac4j/pac4j/hooks","issue_events_url":"https://api.github.com/repos/pac4j/pac4j/issues/events{/number}","events_url":"https://api.github.com/repos/pac4j/pac4j/events","assignees_url":"https://api.github.com/repos/pac4j/pac4j/assignees{/user}","branches_url":"https://api.github.com/repos/pac4j/pac4j/branches{/branch}","tags_url":"https://api.github.com/repos/pac4j/pac4j/tags","blobs_url":"https://api.github.com/repos/pac4j/pac4j/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pac4j/pac4j/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pac4j/pac4j/git/refs{/sha}","trees_url":"https://api.github.com/repos/pac4j/pac4j/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pac4j/pac4j/statuses/{sha}","languages_url":"https://api.github.com/repos/pac4j/pac4j/languages","stargazers_url":"https://api.github.com/repos/pac4j/pac4j/stargazers","contributors_url":"https://api.github.com/repos/pac4j/pac4j/contributors","subscribers_url":"https://api.github.com/repos/pac4j/pac4j/subscribers","subscription_url":"https://api.github.com/repos/pac4j/pac4j/subscription","commits_url":"https://api.github.com/repos/pac4j/pac4j/commits{/sha}","git_commits_url":"https://api.github.com/repos/pac4j/pac4j/git/commits{/sha}","comments_url":"https://api.github.com/repos/pac4j/pac4j/comments{/number}","issue_comment_url":"https://api.github.com/repos/pac4j/pac4j/issues/comments{/number}","contents_url":"https://api.github.com/repos/pac4j/pac4j/contents/{+path}","compare_url":"https://api.github.com/repos/pac4j/pac4j/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pac4j/pac4j/merges","archive_url":"https://api.github.com/repos/pac4j/pac4j/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pac4j/pac4j/downloads","issues_url":"https://api.github.com/repos/pac4j/pac4j/issues{/number}","pulls_url":"https://api.github.com/repos/pac4j/pac4j/pulls{/number}","milestones_url":"https://api.github.com/repos/pac4j/pac4j/milestones{/number}","notifications_url":"https://api.github.com/repos/pac4j/pac4j/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pac4j/pac4j/labels{/name}","releases_url":"https://api.github.com/repos/pac4j/pac4j/releases{/id}","deployments_url":"https://api.github.com/repos/pac4j/pac4j/deployments","created_at":"2012-01-28T17:04:12Z","updated_at":"2016-03-29T12:35:56Z","pushed_at":"2016-03-29T15:55:14Z","git_url":"git://github.com/pac4j/pac4j.git","ssh_url":"git@github.com:pac4j/pac4j.git","clone_url":"https://github.com/pac4j/pac4j.git","svn_url":"https://github.com/pac4j/pac4j","homepage":"http://www.pac4j.org","size":25090,"stargazers_count":501,"watchers_count":501,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":189,"mirror_url":null,"open_issues_count":18,"forks":189,"open_issues":18,"watchers":501,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pac4j/pac4j/pulls/532"},"html":{"href":"https://github.com/pac4j/pac4j/pull/532"},"issue":{"href":"https://api.github.com/repos/pac4j/pac4j/issues/532"},"comments":{"href":"https://api.github.com/repos/pac4j/pac4j/issues/532/comments"},"review_comments":{"href":"https://api.github.com/repos/pac4j/pac4j/pulls/532/comments"},"review_comment":{"href":"https://api.github.com/repos/pac4j/pac4j/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pac4j/pac4j/pulls/532/commits"},"statuses":{"href":"https://api.github.com/repos/pac4j/pac4j/statuses/8ad89468f5a8133188fde1d0eb5243f6d3a755ba"}}}}