{"action":"created","comment":{"url":"https://api.github.com/repos/osiam/osiam/pulls/comments/55945322","id":55945322,"diff_hunk":"@@ -23,186 +23,61 @@\n  */\n package org.osiam.resources.controller;\n \n-import com.fasterxml.jackson.annotation.JsonIgnore;\n-import org.joda.time.format.DateTimeFormatter;\n-import org.joda.time.format.ISODateTimeFormat;\n-import org.osiam.resources.exception.OsiamException;\n+import com.google.common.base.Strings;\n+import org.osiam.resources.exception.InvalidTokenException;\n import org.osiam.resources.scim.User;\n-import org.osiam.security.helper.AccessTokenHelper;\n-import org.osiam.storage.dao.UserDao;\n-import org.osiam.storage.entities.EmailEntity;\n-import org.osiam.storage.entities.NameEntity;\n-import org.osiam.storage.entities.UserEntity;\n import org.springframework.beans.factory.annotation.Autowired;\n+import org.springframework.http.HttpStatus;\n+import org.springframework.http.ResponseEntity;\n import org.springframework.security.core.Authentication;\n import org.springframework.security.oauth2.provider.OAuth2Authentication;\n import org.springframework.security.oauth2.provider.token.ResourceServerTokenServices;\n import org.springframework.transaction.annotation.Transactional;\n+import org.springframework.web.bind.annotation.RequestHeader;\n import org.springframework.web.bind.annotation.RequestMapping;\n import org.springframework.web.bind.annotation.RequestMethod;\n import org.springframework.web.bind.annotation.RestController;\n-\n-import javax.servlet.http.HttpServletRequest;\n-import java.util.Set;\n+import org.springframework.web.util.UriComponentsBuilder;\n \n /**\n  * This Controller is used for getting information about the user who initialised the access_token.\n  */\n @RestController\n-@RequestMapping(value = \"/me\")\n+@RequestMapping(value = \"/Me\")\n @Transactional\n-public class MeController {\n+public class MeController extends ResourceController<User> {\n \n     private final ResourceServerTokenServices resourceServerTokenServices;\n-    private final UserDao userDao;\n \n     @Autowired\n-    public MeController(ResourceServerTokenServices resourceServerTokenServices, UserDao userDao) {\n+    public MeController(ResourceServerTokenServices resourceServerTokenServices) {\n         this.resourceServerTokenServices = resourceServerTokenServices;\n-        this.userDao = userDao;\n     }\n \n-    /**\n-     * This method is used to get information about the user who initialised the authorization process.\n-     * <p/>\n-     * The result should be in json format and look like:\n-     * <p/>\n-     * {\n-     * \"id\": \"73821979327912\",\n-     * \"name\": \"Arthur Dent\",\n-     * \"first_name\": \"Arthur\",\n-     * \"last_name\": \"Dent\",\n-     * \"link\": \"https://www.facebook.com/arthur.dent.167\",\n-     * \"username\": \"arthur.dent.167\",\n-     * \"gender\": \"male\",\n-     * \"email\": \"arthur@dent.de\",\n-     * \"timezone\": 2,\n-     * \"locale\": \"en_US\",\n-     * \"verified\": true,\n-     * \"updated_time\": \"2012-08-20T08:03:30+0000\"\n-     * }\n-     * <p/>\n-     * if some information are not available then ... will happen.\n-     *\n-     * @return an object to represent the json format.\n-     */\n-    @RequestMapping(value = \"/**\", method = {RequestMethod.GET, RequestMethod.POST})\n-    public FacebookInformationConstruct getInformation(HttpServletRequest request) {\n-        String accessToken = getAccessToken(request);\n+    @RequestMapping(method = RequestMethod.GET)\n+    public ResponseEntity<User> getCurrentUser(@RequestHeader(\"Authorization\") String tokenHeader,","path":"src/main/java/org/osiam/resources/controller/MeController.java","position":80,"original_position":80,"commit_id":"657032d5a744588e2d38e24638cc8cc4b56212e9","original_commit_id":"657032d5a744588e2d38e24638cc8cc4b56212e9","user":{"login":"dacrome","id":1593279,"avatar_url":"https://avatars.githubusercontent.com/u/1593279?v=3","gravatar_id":"","url":"https://api.github.com/users/dacrome","html_url":"https://github.com/dacrome","followers_url":"https://api.github.com/users/dacrome/followers","following_url":"https://api.github.com/users/dacrome/following{/other_user}","gists_url":"https://api.github.com/users/dacrome/gists{/gist_id}","starred_url":"https://api.github.com/users/dacrome/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dacrome/subscriptions","organizations_url":"https://api.github.com/users/dacrome/orgs","repos_url":"https://api.github.com/users/dacrome/repos","events_url":"https://api.github.com/users/dacrome/events{/privacy}","received_events_url":"https://api.github.com/users/dacrome/received_events","type":"User","site_admin":false},"body":"what about the attributes filtering?","created_at":"2016-03-13T22:45:25Z","updated_at":"2016-03-13T22:45:25Z","html_url":"https://github.com/osiam/osiam/pull/185#discussion_r55945322","pull_request_url":"https://api.github.com/repos/osiam/osiam/pulls/185","_links":{"self":{"href":"https://api.github.com/repos/osiam/osiam/pulls/comments/55945322"},"html":{"href":"https://github.com/osiam/osiam/pull/185#discussion_r55945322"},"pull_request":{"href":"https://api.github.com/repos/osiam/osiam/pulls/185"}}},"pull_request":{"url":"https://api.github.com/repos/osiam/osiam/pulls/185","id":62305008,"html_url":"https://github.com/osiam/osiam/pull/185","diff_url":"https://github.com/osiam/osiam/pull/185.diff","patch_url":"https://github.com/osiam/osiam/pull/185.patch","issue_url":"https://api.github.com/repos/osiam/osiam/issues/185","number":185,"state":"open","locked":false,"title":"Make '/Me' resource SCIM 2 compliant","user":{"login":"wallner","id":563601,"avatar_url":"https://avatars.githubusercontent.com/u/563601?v=3","gravatar_id":"","url":"https://api.github.com/users/wallner","html_url":"https://github.com/wallner","followers_url":"https://api.github.com/users/wallner/followers","following_url":"https://api.github.com/users/wallner/following{/other_user}","gists_url":"https://api.github.com/users/wallner/gists{/gist_id}","starred_url":"https://api.github.com/users/wallner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wallner/subscriptions","organizations_url":"https://api.github.com/users/wallner/orgs","repos_url":"https://api.github.com/users/wallner/repos","events_url":"https://api.github.com/users/wallner/events{/privacy}","received_events_url":"https://api.github.com/users/wallner/received_events","type":"User","site_admin":false},"body":"This pull request makes the `/Me` resource SCIM 2 compliant and removes support for the unused fake Facebook api. It makes authenticated queries to '/Me' return a standard SCIM `User` representation of the authenticated user performing the request. Please be aware that this PR has two dependent pull requests: osiam/connector4java#196 and osiam/connector4java-integration-tests#333 This pull request closes #141 and closes #153 ","created_at":"2016-03-09T22:11:38Z","updated_at":"2016-03-13T22:45:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"03b796917a5703f9f65f5855401e3084b37a1f82","assignee":{"login":"dacrome","id":1593279,"avatar_url":"https://avatars.githubusercontent.com/u/1593279?v=3","gravatar_id":"","url":"https://api.github.com/users/dacrome","html_url":"https://github.com/dacrome","followers_url":"https://api.github.com/users/dacrome/followers","following_url":"https://api.github.com/users/dacrome/following{/other_user}","gists_url":"https://api.github.com/users/dacrome/gists{/gist_id}","starred_url":"https://api.github.com/users/dacrome/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dacrome/subscriptions","organizations_url":"https://api.github.com/users/dacrome/orgs","repos_url":"https://api.github.com/users/dacrome/repos","events_url":"https://api.github.com/users/dacrome/events{/privacy}","received_events_url":"https://api.github.com/users/dacrome/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/osiam/osiam/pulls/185/commits","review_comments_url":"https://api.github.com/repos/osiam/osiam/pulls/185/comments","review_comment_url":"https://api.github.com/repos/osiam/osiam/pulls/comments{/number}","comments_url":"https://api.github.com/repos/osiam/osiam/issues/185/comments","statuses_url":"https://api.github.com/repos/osiam/osiam/statuses/657032d5a744588e2d38e24638cc8cc4b56212e9","head":{"label":"wallner:remove_me_resource","ref":"remove_me_resource","sha":"657032d5a744588e2d38e24638cc8cc4b56212e9","user":{"login":"wallner","id":563601,"avatar_url":"https://avatars.githubusercontent.com/u/563601?v=3","gravatar_id":"","url":"https://api.github.com/users/wallner","html_url":"https://github.com/wallner","followers_url":"https://api.github.com/users/wallner/followers","following_url":"https://api.github.com/users/wallner/following{/other_user}","gists_url":"https://api.github.com/users/wallner/gists{/gist_id}","starred_url":"https://api.github.com/users/wallner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wallner/subscriptions","organizations_url":"https://api.github.com/users/wallner/orgs","repos_url":"https://api.github.com/users/wallner/repos","events_url":"https://api.github.com/users/wallner/events{/privacy}","received_events_url":"https://api.github.com/users/wallner/received_events","type":"User","site_admin":false},"repo":{"id":39103671,"name":"osiam","full_name":"wallner/osiam","owner":{"login":"wallner","id":563601,"avatar_url":"https://avatars.githubusercontent.com/u/563601?v=3","gravatar_id":"","url":"https://api.github.com/users/wallner","html_url":"https://github.com/wallner","followers_url":"https://api.github.com/users/wallner/followers","following_url":"https://api.github.com/users/wallner/following{/other_user}","gists_url":"https://api.github.com/users/wallner/gists{/gist_id}","starred_url":"https://api.github.com/users/wallner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wallner/subscriptions","organizations_url":"https://api.github.com/users/wallner/orgs","repos_url":"https://api.github.com/users/wallner/repos","events_url":"https://api.github.com/users/wallner/events{/privacy}","received_events_url":"https://api.github.com/users/wallner/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wallner/osiam","description":"MIT licensed Open Source Identity and Access Management implementing OAuth 2.0 and SCIMv2.","fork":true,"url":"https://api.github.com/repos/wallner/osiam","forks_url":"https://api.github.com/repos/wallner/osiam/forks","keys_url":"https://api.github.com/repos/wallner/osiam/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wallner/osiam/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wallner/osiam/teams","hooks_url":"https://api.github.com/repos/wallner/osiam/hooks","issue_events_url":"https://api.github.com/repos/wallner/osiam/issues/events{/number}","events_url":"https://api.github.com/repos/wallner/osiam/events","assignees_url":"https://api.github.com/repos/wallner/osiam/assignees{/user}","branches_url":"https://api.github.com/repos/wallner/osiam/branches{/branch}","tags_url":"https://api.github.com/repos/wallner/osiam/tags","blobs_url":"https://api.github.com/repos/wallner/osiam/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wallner/osiam/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wallner/osiam/git/refs{/sha}","trees_url":"https://api.github.com/repos/wallner/osiam/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wallner/osiam/statuses/{sha}","languages_url":"https://api.github.com/repos/wallner/osiam/languages","stargazers_url":"https://api.github.com/repos/wallner/osiam/stargazers","contributors_url":"https://api.github.com/repos/wallner/osiam/contributors","subscribers_url":"https://api.github.com/repos/wallner/osiam/subscribers","subscription_url":"https://api.github.com/repos/wallner/osiam/subscription","commits_url":"https://api.github.com/repos/wallner/osiam/commits{/sha}","git_commits_url":"https://api.github.com/repos/wallner/osiam/git/commits{/sha}","comments_url":"https://api.github.com/repos/wallner/osiam/comments{/number}","issue_comment_url":"https://api.github.com/repos/wallner/osiam/issues/comments{/number}","contents_url":"https://api.github.com/repos/wallner/osiam/contents/{+path}","compare_url":"https://api.github.com/repos/wallner/osiam/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wallner/osiam/merges","archive_url":"https://api.github.com/repos/wallner/osiam/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wallner/osiam/downloads","issues_url":"https://api.github.com/repos/wallner/osiam/issues{/number}","pulls_url":"https://api.github.com/repos/wallner/osiam/pulls{/number}","milestones_url":"https://api.github.com/repos/wallner/osiam/milestones{/number}","notifications_url":"https://api.github.com/repos/wallner/osiam/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wallner/osiam/labels{/name}","releases_url":"https://api.github.com/repos/wallner/osiam/releases{/id}","deployments_url":"https://api.github.com/repos/wallner/osiam/deployments","created_at":"2015-07-14T22:29:08Z","updated_at":"2015-06-22T16:38:13Z","pushed_at":"2016-03-13T22:40:07Z","git_url":"git://github.com/wallner/osiam.git","ssh_url":"git@github.com:wallner/osiam.git","clone_url":"https://github.com/wallner/osiam.git","svn_url":"https://github.com/wallner/osiam","homepage":"https://www.osiam.org","size":3238,"stargazers_count":0,"watchers_count":0,"language":null,"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":"osiam:master","ref":"master","sha":"90cd6408256996acff396bd9dbd1be4f7583a3b9","user":{"login":"osiam","id":1918807,"avatar_url":"https://avatars.githubusercontent.com/u/1918807?v=3","gravatar_id":"","url":"https://api.github.com/users/osiam","html_url":"https://github.com/osiam","followers_url":"https://api.github.com/users/osiam/followers","following_url":"https://api.github.com/users/osiam/following{/other_user}","gists_url":"https://api.github.com/users/osiam/gists{/gist_id}","starred_url":"https://api.github.com/users/osiam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/osiam/subscriptions","organizations_url":"https://api.github.com/users/osiam/orgs","repos_url":"https://api.github.com/users/osiam/repos","events_url":"https://api.github.com/users/osiam/events{/privacy}","received_events_url":"https://api.github.com/users/osiam/received_events","type":"Organization","site_admin":false},"repo":{"id":34720631,"name":"osiam","full_name":"osiam/osiam","owner":{"login":"osiam","id":1918807,"avatar_url":"https://avatars.githubusercontent.com/u/1918807?v=3","gravatar_id":"","url":"https://api.github.com/users/osiam","html_url":"https://github.com/osiam","followers_url":"https://api.github.com/users/osiam/followers","following_url":"https://api.github.com/users/osiam/following{/other_user}","gists_url":"https://api.github.com/users/osiam/gists{/gist_id}","starred_url":"https://api.github.com/users/osiam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/osiam/subscriptions","organizations_url":"https://api.github.com/users/osiam/orgs","repos_url":"https://api.github.com/users/osiam/repos","events_url":"https://api.github.com/users/osiam/events{/privacy}","received_events_url":"https://api.github.com/users/osiam/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/osiam/osiam","description":"MIT licensed Open Source Identity and Access Management implementing OAuth 2.0 and SCIMv2.","fork":false,"url":"https://api.github.com/repos/osiam/osiam","forks_url":"https://api.github.com/repos/osiam/osiam/forks","keys_url":"https://api.github.com/repos/osiam/osiam/keys{/key_id}","collaborators_url":"https://api.github.com/repos/osiam/osiam/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/osiam/osiam/teams","hooks_url":"https://api.github.com/repos/osiam/osiam/hooks","issue_events_url":"https://api.github.com/repos/osiam/osiam/issues/events{/number}","events_url":"https://api.github.com/repos/osiam/osiam/events","assignees_url":"https://api.github.com/repos/osiam/osiam/assignees{/user}","branches_url":"https://api.github.com/repos/osiam/osiam/branches{/branch}","tags_url":"https://api.github.com/repos/osiam/osiam/tags","blobs_url":"https://api.github.com/repos/osiam/osiam/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/osiam/osiam/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/osiam/osiam/git/refs{/sha}","trees_url":"https://api.github.com/repos/osiam/osiam/git/trees{/sha}","statuses_url":"https://api.github.com/repos/osiam/osiam/statuses/{sha}","languages_url":"https://api.github.com/repos/osiam/osiam/languages","stargazers_url":"https://api.github.com/repos/osiam/osiam/stargazers","contributors_url":"https://api.github.com/repos/osiam/osiam/contributors","subscribers_url":"https://api.github.com/repos/osiam/osiam/subscribers","subscription_url":"https://api.github.com/repos/osiam/osiam/subscription","commits_url":"https://api.github.com/repos/osiam/osiam/commits{/sha}","git_commits_url":"https://api.github.com/repos/osiam/osiam/git/commits{/sha}","comments_url":"https://api.github.com/repos/osiam/osiam/comments{/number}","issue_comment_url":"https://api.github.com/repos/osiam/osiam/issues/comments{/number}","contents_url":"https://api.github.com/repos/osiam/osiam/contents/{+path}","compare_url":"https://api.github.com/repos/osiam/osiam/compare/{base}...{head}","merges_url":"https://api.github.com/repos/osiam/osiam/merges","archive_url":"https://api.github.com/repos/osiam/osiam/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/osiam/osiam/downloads","issues_url":"https://api.github.com/repos/osiam/osiam/issues{/number}","pulls_url":"https://api.github.com/repos/osiam/osiam/pulls{/number}","milestones_url":"https://api.github.com/repos/osiam/osiam/milestones{/number}","notifications_url":"https://api.github.com/repos/osiam/osiam/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/osiam/osiam/labels{/name}","releases_url":"https://api.github.com/repos/osiam/osiam/releases{/id}","deployments_url":"https://api.github.com/repos/osiam/osiam/deployments","created_at":"2015-04-28T09:14:40Z","updated_at":"2016-03-13T19:20:07Z","pushed_at":"2016-03-13T22:40:07Z","git_url":"git://github.com/osiam/osiam.git","ssh_url":"git@github.com:osiam/osiam.git","clone_url":"https://github.com/osiam/osiam.git","svn_url":"https://github.com/osiam/osiam","homepage":"http://osiam.github.io/","size":3261,"stargazers_count":28,"watchers_count":28,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":48,"forks":9,"open_issues":48,"watchers":28,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/osiam/osiam/pulls/185"},"html":{"href":"https://github.com/osiam/osiam/pull/185"},"issue":{"href":"https://api.github.com/repos/osiam/osiam/issues/185"},"comments":{"href":"https://api.github.com/repos/osiam/osiam/issues/185/comments"},"review_comments":{"href":"https://api.github.com/repos/osiam/osiam/pulls/185/comments"},"review_comment":{"href":"https://api.github.com/repos/osiam/osiam/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/osiam/osiam/pulls/185/commits"},"statuses":{"href":"https://api.github.com/repos/osiam/osiam/statuses/657032d5a744588e2d38e24638cc8cc4b56212e9"}}}}