{"action":"created","comment":{"url":"https://api.github.com/repos/wso2/carbon-identity/pulls/comments/37741839","id":37741839,"diff_hunk":"@@ -1192,4 +1231,52 @@ private void provision(ProvisioningOperation provisioningMethod, SCIMObject prov\n             throw new CharonException(\"Error while provisioning to externaluser store in dumb mode.\", e);\n         }\n     }\n+\n+    private String getUserStoreDomainFromSP() throws IdentityApplicationManagementException {\n+\n+        ThreadLocalProvisioningServiceProvider threadLocalSP = IdentityApplicationManagementUtil\n+                .getThreadLocalProvisioningServiceProvider();\n+        ServiceProvider serviceProvider = null;\n+        if (threadLocalSP.getServiceProviderType() == ProvisioningServiceProviderType.OAUTH) {\n+            serviceProvider = ApplicationManagementService.getInstance()\n+                                                          .getServiceProviderByClientId(\n+                                                                  threadLocalSP.getServiceProviderName(),\n+                                                                  \"oauth2\", threadLocalSP.getTenantDomain());\n+        } else {\n+            serviceProvider = ApplicationManagementService.getInstance().getServiceProvider(\n+                    threadLocalSP.getServiceProviderName(), threadLocalSP.getTenantDomain());\n+        }\n+\n+        if (serviceProvider != null && serviceProvider.getInboundProvisioningConfig() != null) {\n+            return serviceProvider.getInboundProvisioningConfig().getProvisioningUserStore();\n+        }\n+        return null;\n+    }\n+\n+    private Group addDomainToUserMembers(Group group, String userStoreDomain) throws CharonException {\n+        List<String> membersId = group.getMembers();\n+\n+        if (StringUtils.isBlank(userStoreDomain) || membersId == null || membersId.isEmpty()) {\n+            return group;\n+        }\n+","path":"components/scim/org.wso2.carbon.identity.scim.provider/src/main/java/org/wso2/carbon/identity/scim/provider/impl/SCIMUserManager.java","position":197,"original_position":197,"commit_id":"97735500ac465a760612f365bc13a3dbbd4073ef","original_commit_id":"97735500ac465a760612f365bc13a3dbbd4073ef","user":{"login":"isharak","id":7835405,"avatar_url":"https://avatars.githubusercontent.com/u/7835405?v=3","gravatar_id":"","url":"https://api.github.com/users/isharak","html_url":"https://github.com/isharak","followers_url":"https://api.github.com/users/isharak/followers","following_url":"https://api.github.com/users/isharak/following{/other_user}","gists_url":"https://api.github.com/users/isharak/gists{/gist_id}","starred_url":"https://api.github.com/users/isharak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/isharak/subscriptions","organizations_url":"https://api.github.com/users/isharak/orgs","repos_url":"https://api.github.com/users/isharak/repos","events_url":"https://api.github.com/users/isharak/events{/privacy}","received_events_url":"https://api.github.com/users/isharak/received_events","type":"User","site_admin":false},"body":"Better to create a map with ID and displayname initially instead using two independent arryalists ","created_at":"2015-08-24T11:31:20Z","updated_at":"2015-08-24T11:31:20Z","html_url":"https://github.com/wso2/carbon-identity/pull/856#discussion_r37741839","pull_request_url":"https://api.github.com/repos/wso2/carbon-identity/pulls/856","_links":{"self":{"href":"https://api.github.com/repos/wso2/carbon-identity/pulls/comments/37741839"},"html":{"href":"https://github.com/wso2/carbon-identity/pull/856#discussion_r37741839"},"pull_request":{"href":"https://api.github.com/repos/wso2/carbon-identity/pulls/856"}}},"pull_request":{"url":"https://api.github.com/repos/wso2/carbon-identity/pulls/856","id":43153985,"html_url":"https://github.com/wso2/carbon-identity/pull/856","diff_url":"https://github.com/wso2/carbon-identity/pull/856.diff","patch_url":"https://github.com/wso2/carbon-identity/pull/856.patch","issue_url":"https://api.github.com/repos/wso2/carbon-identity/issues/856","number":856,"state":"open","locked":false,"title":"Identity 3230","user":{"login":"GayanM","id":3436694,"avatar_url":"https://avatars.githubusercontent.com/u/3436694?v=3","gravatar_id":"","url":"https://api.github.com/users/GayanM","html_url":"https://github.com/GayanM","followers_url":"https://api.github.com/users/GayanM/followers","following_url":"https://api.github.com/users/GayanM/following{/other_user}","gists_url":"https://api.github.com/users/GayanM/gists{/gist_id}","starred_url":"https://api.github.com/users/GayanM/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GayanM/subscriptions","organizations_url":"https://api.github.com/users/GayanM/orgs","repos_url":"https://api.github.com/users/GayanM/repos","events_url":"https://api.github.com/users/GayanM/events{/privacy}","received_events_url":"https://api.github.com/users/GayanM/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-08-24T09:12:09Z","updated_at":"2015-08-24T11:31:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e5c483742c650ea6246b06373302ddd45870613d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/wso2/carbon-identity/pulls/856/commits","review_comments_url":"https://api.github.com/repos/wso2/carbon-identity/pulls/856/comments","review_comment_url":"https://api.github.com/repos/wso2/carbon-identity/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wso2/carbon-identity/issues/856/comments","statuses_url":"https://api.github.com/repos/wso2/carbon-identity/statuses/97735500ac465a760612f365bc13a3dbbd4073ef","head":{"label":"GayanM:IDENTITY-3230","ref":"IDENTITY-3230","sha":"97735500ac465a760612f365bc13a3dbbd4073ef","user":{"login":"GayanM","id":3436694,"avatar_url":"https://avatars.githubusercontent.com/u/3436694?v=3","gravatar_id":"","url":"https://api.github.com/users/GayanM","html_url":"https://github.com/GayanM","followers_url":"https://api.github.com/users/GayanM/followers","following_url":"https://api.github.com/users/GayanM/following{/other_user}","gists_url":"https://api.github.com/users/GayanM/gists{/gist_id}","starred_url":"https://api.github.com/users/GayanM/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GayanM/subscriptions","organizations_url":"https://api.github.com/users/GayanM/orgs","repos_url":"https://api.github.com/users/GayanM/repos","events_url":"https://api.github.com/users/GayanM/events{/privacy}","received_events_url":"https://api.github.com/users/GayanM/received_events","type":"User","site_admin":false},"repo":{"id":38152023,"name":"carbon-identity","full_name":"GayanM/carbon-identity","owner":{"login":"GayanM","id":3436694,"avatar_url":"https://avatars.githubusercontent.com/u/3436694?v=3","gravatar_id":"","url":"https://api.github.com/users/GayanM","html_url":"https://github.com/GayanM","followers_url":"https://api.github.com/users/GayanM/followers","following_url":"https://api.github.com/users/GayanM/following{/other_user}","gists_url":"https://api.github.com/users/GayanM/gists{/gist_id}","starred_url":"https://api.github.com/users/GayanM/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GayanM/subscriptions","organizations_url":"https://api.github.com/users/GayanM/orgs","repos_url":"https://api.github.com/users/GayanM/repos","events_url":"https://api.github.com/users/GayanM/events{/privacy}","received_events_url":"https://api.github.com/users/GayanM/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/GayanM/carbon-identity","description":"","fork":true,"url":"https://api.github.com/repos/GayanM/carbon-identity","forks_url":"https://api.github.com/repos/GayanM/carbon-identity/forks","keys_url":"https://api.github.com/repos/GayanM/carbon-identity/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GayanM/carbon-identity/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GayanM/carbon-identity/teams","hooks_url":"https://api.github.com/repos/GayanM/carbon-identity/hooks","issue_events_url":"https://api.github.com/repos/GayanM/carbon-identity/issues/events{/number}","events_url":"https://api.github.com/repos/GayanM/carbon-identity/events","assignees_url":"https://api.github.com/repos/GayanM/carbon-identity/assignees{/user}","branches_url":"https://api.github.com/repos/GayanM/carbon-identity/branches{/branch}","tags_url":"https://api.github.com/repos/GayanM/carbon-identity/tags","blobs_url":"https://api.github.com/repos/GayanM/carbon-identity/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GayanM/carbon-identity/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GayanM/carbon-identity/git/refs{/sha}","trees_url":"https://api.github.com/repos/GayanM/carbon-identity/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GayanM/carbon-identity/statuses/{sha}","languages_url":"https://api.github.com/repos/GayanM/carbon-identity/languages","stargazers_url":"https://api.github.com/repos/GayanM/carbon-identity/stargazers","contributors_url":"https://api.github.com/repos/GayanM/carbon-identity/contributors","subscribers_url":"https://api.github.com/repos/GayanM/carbon-identity/subscribers","subscription_url":"https://api.github.com/repos/GayanM/carbon-identity/subscription","commits_url":"https://api.github.com/repos/GayanM/carbon-identity/commits{/sha}","git_commits_url":"https://api.github.com/repos/GayanM/carbon-identity/git/commits{/sha}","comments_url":"https://api.github.com/repos/GayanM/carbon-identity/comments{/number}","issue_comment_url":"https://api.github.com/repos/GayanM/carbon-identity/issues/comments{/number}","contents_url":"https://api.github.com/repos/GayanM/carbon-identity/contents/{+path}","compare_url":"https://api.github.com/repos/GayanM/carbon-identity/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GayanM/carbon-identity/merges","archive_url":"https://api.github.com/repos/GayanM/carbon-identity/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GayanM/carbon-identity/downloads","issues_url":"https://api.github.com/repos/GayanM/carbon-identity/issues{/number}","pulls_url":"https://api.github.com/repos/GayanM/carbon-identity/pulls{/number}","milestones_url":"https://api.github.com/repos/GayanM/carbon-identity/milestones{/number}","notifications_url":"https://api.github.com/repos/GayanM/carbon-identity/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GayanM/carbon-identity/labels{/name}","releases_url":"https://api.github.com/repos/GayanM/carbon-identity/releases{/id}","created_at":"2015-06-27T07:51:05Z","updated_at":"2015-06-27T07:51:16Z","pushed_at":"2015-08-24T10:28:58Z","git_url":"git://github.com/GayanM/carbon-identity.git","ssh_url":"git@github.com:GayanM/carbon-identity.git","clone_url":"https://github.com/GayanM/carbon-identity.git","svn_url":"https://github.com/GayanM/carbon-identity","homepage":null,"size":44997,"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":"wso2:master","ref":"master","sha":"18ec9bde5ca6059ea0e48d4ad5c6badc3623b646","user":{"login":"wso2","id":533043,"avatar_url":"https://avatars.githubusercontent.com/u/533043?v=3","gravatar_id":"","url":"https://api.github.com/users/wso2","html_url":"https://github.com/wso2","followers_url":"https://api.github.com/users/wso2/followers","following_url":"https://api.github.com/users/wso2/following{/other_user}","gists_url":"https://api.github.com/users/wso2/gists{/gist_id}","starred_url":"https://api.github.com/users/wso2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wso2/subscriptions","organizations_url":"https://api.github.com/users/wso2/orgs","repos_url":"https://api.github.com/users/wso2/repos","events_url":"https://api.github.com/users/wso2/events{/privacy}","received_events_url":"https://api.github.com/users/wso2/received_events","type":"Organization","site_admin":false},"repo":{"id":16588204,"name":"carbon-identity","full_name":"wso2/carbon-identity","owner":{"login":"wso2","id":533043,"avatar_url":"https://avatars.githubusercontent.com/u/533043?v=3","gravatar_id":"","url":"https://api.github.com/users/wso2","html_url":"https://github.com/wso2","followers_url":"https://api.github.com/users/wso2/followers","following_url":"https://api.github.com/users/wso2/following{/other_user}","gists_url":"https://api.github.com/users/wso2/gists{/gist_id}","starred_url":"https://api.github.com/users/wso2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wso2/subscriptions","organizations_url":"https://api.github.com/users/wso2/orgs","repos_url":"https://api.github.com/users/wso2/repos","events_url":"https://api.github.com/users/wso2/events{/privacy}","received_events_url":"https://api.github.com/users/wso2/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wso2/carbon-identity","description":"","fork":false,"url":"https://api.github.com/repos/wso2/carbon-identity","forks_url":"https://api.github.com/repos/wso2/carbon-identity/forks","keys_url":"https://api.github.com/repos/wso2/carbon-identity/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wso2/carbon-identity/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wso2/carbon-identity/teams","hooks_url":"https://api.github.com/repos/wso2/carbon-identity/hooks","issue_events_url":"https://api.github.com/repos/wso2/carbon-identity/issues/events{/number}","events_url":"https://api.github.com/repos/wso2/carbon-identity/events","assignees_url":"https://api.github.com/repos/wso2/carbon-identity/assignees{/user}","branches_url":"https://api.github.com/repos/wso2/carbon-identity/branches{/branch}","tags_url":"https://api.github.com/repos/wso2/carbon-identity/tags","blobs_url":"https://api.github.com/repos/wso2/carbon-identity/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wso2/carbon-identity/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wso2/carbon-identity/git/refs{/sha}","trees_url":"https://api.github.com/repos/wso2/carbon-identity/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wso2/carbon-identity/statuses/{sha}","languages_url":"https://api.github.com/repos/wso2/carbon-identity/languages","stargazers_url":"https://api.github.com/repos/wso2/carbon-identity/stargazers","contributors_url":"https://api.github.com/repos/wso2/carbon-identity/contributors","subscribers_url":"https://api.github.com/repos/wso2/carbon-identity/subscribers","subscription_url":"https://api.github.com/repos/wso2/carbon-identity/subscription","commits_url":"https://api.github.com/repos/wso2/carbon-identity/commits{/sha}","git_commits_url":"https://api.github.com/repos/wso2/carbon-identity/git/commits{/sha}","comments_url":"https://api.github.com/repos/wso2/carbon-identity/comments{/number}","issue_comment_url":"https://api.github.com/repos/wso2/carbon-identity/issues/comments{/number}","contents_url":"https://api.github.com/repos/wso2/carbon-identity/contents/{+path}","compare_url":"https://api.github.com/repos/wso2/carbon-identity/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wso2/carbon-identity/merges","archive_url":"https://api.github.com/repos/wso2/carbon-identity/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wso2/carbon-identity/downloads","issues_url":"https://api.github.com/repos/wso2/carbon-identity/issues{/number}","pulls_url":"https://api.github.com/repos/wso2/carbon-identity/pulls{/number}","milestones_url":"https://api.github.com/repos/wso2/carbon-identity/milestones{/number}","notifications_url":"https://api.github.com/repos/wso2/carbon-identity/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wso2/carbon-identity/labels{/name}","releases_url":"https://api.github.com/repos/wso2/carbon-identity/releases{/id}","created_at":"2014-02-06T17:58:23Z","updated_at":"2015-07-24T18:32:22Z","pushed_at":"2015-08-24T11:19:53Z","git_url":"git://github.com/wso2/carbon-identity.git","ssh_url":"git@github.com:wso2/carbon-identity.git","clone_url":"https://github.com/wso2/carbon-identity.git","svn_url":"https://github.com/wso2/carbon-identity","homepage":null,"size":105076,"stargazers_count":6,"watchers_count":6,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":116,"mirror_url":null,"open_issues_count":46,"forks":116,"open_issues":46,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wso2/carbon-identity/pulls/856"},"html":{"href":"https://github.com/wso2/carbon-identity/pull/856"},"issue":{"href":"https://api.github.com/repos/wso2/carbon-identity/issues/856"},"comments":{"href":"https://api.github.com/repos/wso2/carbon-identity/issues/856/comments"},"review_comments":{"href":"https://api.github.com/repos/wso2/carbon-identity/pulls/856/comments"},"review_comment":{"href":"https://api.github.com/repos/wso2/carbon-identity/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wso2/carbon-identity/pulls/856/commits"},"statuses":{"href":"https://api.github.com/repos/wso2/carbon-identity/statuses/97735500ac465a760612f365bc13a3dbbd4073ef"}}}}