{"action":"created","comment":{"url":"https://api.github.com/repos/osiam/auth-server/pulls/comments/39130416","id":39130416,"diff_hunk":"@@ -0,0 +1,100 @@\n+package org.osiam.auth.configuration;\n+\n+import org.osiam.auth.login.OsiamCachingAuthenticationFailureHandler;\n+import org.osiam.auth.login.internal.InternalAuthenticationProvider;\n+import org.osiam.auth.login.ldap.OsiamLdapAuthenticationProvider;\n+import org.osiam.security.helper.LoginDecisionFilter;\n+import org.springframework.beans.factory.annotation.Autowired;\n+import org.springframework.context.annotation.Bean;\n+import org.springframework.context.annotation.Configuration;\n+import org.springframework.core.annotation.Order;\n+import org.springframework.security.authentication.AuthenticationManager;\n+import org.springframework.security.authentication.encoding.ShaPasswordEncoder;\n+import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;\n+import org.springframework.security.config.annotation.web.builders.HttpSecurity;\n+import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;\n+import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;\n+import org.springframework.security.config.http.SessionCreationPolicy;\n+import org.springframework.security.web.authentication.LoginUrlAuthenticationEntryPoint;\n+import org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler;\n+import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;\n+\n+@Configuration\n+@Order\n+@EnableWebSecurity\n+public class WebApplicationSecurity extends WebSecurityConfigurerAdapter {\n+\n+    @Autowired\n+    private InternalAuthenticationProvider internalAuthenticationProvider;\n+\n+    @Autowired(required = false)\n+    private OsiamLdapAuthenticationProvider osiamLdapAuthenticationProvider;\n+\n+    @Override\n+    protected void configure(HttpSecurity http) throws Exception {\n+        http.authorizeRequests()\n+                .antMatchers(\"/login\")\n+                .permitAll()\n+                .antMatchers(\"/oauth/**\")\n+                .authenticated()\n+                .and()\n+                // TODO: This is a bad idea! We need CSRF at least for the `/oauth/authorize` endpoint","path":"src/main/java/org/osiam/auth/configuration/WebApplicationSecurity.java","position":41,"original_position":41,"commit_id":"bd2c9da59fcb7f0aee16f4cc02b1368b042c2fcd","original_commit_id":"bd2c9da59fcb7f0aee16f4cc02b1368b042c2fcd","user":{"login":"tkrille","id":5213491,"avatar_url":"https://avatars.githubusercontent.com/u/5213491?v=3","gravatar_id":"","url":"https://api.github.com/users/tkrille","html_url":"https://github.com/tkrille","followers_url":"https://api.github.com/users/tkrille/followers","following_url":"https://api.github.com/users/tkrille/following{/other_user}","gists_url":"https://api.github.com/users/tkrille/gists{/gist_id}","starred_url":"https://api.github.com/users/tkrille/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tkrille/subscriptions","organizations_url":"https://api.github.com/users/tkrille/orgs","repos_url":"https://api.github.com/users/tkrille/repos","events_url":"https://api.github.com/users/tkrille/events{/privacy}","received_events_url":"https://api.github.com/users/tkrille/received_events","type":"User","site_admin":false},"body":"I'll go with the 2nd option.","created_at":"2015-09-10T07:11:26Z","updated_at":"2015-09-10T07:11:26Z","html_url":"https://github.com/osiam/auth-server/pull/50#discussion_r39130416","pull_request_url":"https://api.github.com/repos/osiam/auth-server/pulls/50","_links":{"self":{"href":"https://api.github.com/repos/osiam/auth-server/pulls/comments/39130416"},"html":{"href":"https://github.com/osiam/auth-server/pull/50#discussion_r39130416"},"pull_request":{"href":"https://api.github.com/repos/osiam/auth-server/pulls/50"}}},"pull_request":{"url":"https://api.github.com/repos/osiam/auth-server/pulls/50","id":41573261,"html_url":"https://github.com/osiam/auth-server/pull/50","diff_url":"https://github.com/osiam/auth-server/pull/50.diff","patch_url":"https://github.com/osiam/auth-server/pull/50.patch","issue_url":"https://api.github.com/repos/osiam/auth-server/issues/50","number":50,"state":"open","locked":true,"title":"Switch to Java Config, Spring Boot and Spring Security OAuth 2.0.7","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":"Generates war which is useable like before. Is also a fat war and\r\nstartable with java -jar.\r\nImporting most xml configuration because of migrating issues, but\r\nthe full switch to java configuration (#23) should be done as soon\r\nas possible.\r\n\r\nCloses #24","created_at":"2015-08-04T14:06:51Z","updated_at":"2015-09-10T07:11:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"74f872939a6f69f93689e43013d07ceeec6f012e","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":{"url":"https://api.github.com/repos/osiam/auth-server/milestones/2","html_url":"https://github.com/osiam/auth-server/milestones/v3.0","labels_url":"https://api.github.com/repos/osiam/auth-server/milestones/2/labels","id":1251953,"number":2,"title":"v3.0","description":null,"creator":{"login":"tkrille","id":5213491,"avatar_url":"https://avatars.githubusercontent.com/u/5213491?v=3","gravatar_id":"","url":"https://api.github.com/users/tkrille","html_url":"https://github.com/tkrille","followers_url":"https://api.github.com/users/tkrille/followers","following_url":"https://api.github.com/users/tkrille/following{/other_user}","gists_url":"https://api.github.com/users/tkrille/gists{/gist_id}","starred_url":"https://api.github.com/users/tkrille/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tkrille/subscriptions","organizations_url":"https://api.github.com/users/tkrille/orgs","repos_url":"https://api.github.com/users/tkrille/repos","events_url":"https://api.github.com/users/tkrille/events{/privacy}","received_events_url":"https://api.github.com/users/tkrille/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":14,"state":"open","created_at":"2015-08-12T15:24:11Z","updated_at":"2015-08-19T09:38:53Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/osiam/auth-server/pulls/50/commits","review_comments_url":"https://api.github.com/repos/osiam/auth-server/pulls/50/comments","review_comment_url":"https://api.github.com/repos/osiam/auth-server/pulls/comments{/number}","comments_url":"https://api.github.com/repos/osiam/auth-server/issues/50/comments","statuses_url":"https://api.github.com/repos/osiam/auth-server/statuses/bd2c9da59fcb7f0aee16f4cc02b1368b042c2fcd","head":{"label":"dacrome:spring-boot-xml-config","ref":"spring-boot-xml-config","sha":"bd2c9da59fcb7f0aee16f4cc02b1368b042c2fcd","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},"repo":{"id":34858479,"name":"auth-server","full_name":"dacrome/auth-server","owner":{"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},"private":false,"html_url":"https://github.com/dacrome/auth-server","description":"OSIAM auth-server","fork":true,"url":"https://api.github.com/repos/dacrome/auth-server","forks_url":"https://api.github.com/repos/dacrome/auth-server/forks","keys_url":"https://api.github.com/repos/dacrome/auth-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dacrome/auth-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dacrome/auth-server/teams","hooks_url":"https://api.github.com/repos/dacrome/auth-server/hooks","issue_events_url":"https://api.github.com/repos/dacrome/auth-server/issues/events{/number}","events_url":"https://api.github.com/repos/dacrome/auth-server/events","assignees_url":"https://api.github.com/repos/dacrome/auth-server/assignees{/user}","branches_url":"https://api.github.com/repos/dacrome/auth-server/branches{/branch}","tags_url":"https://api.github.com/repos/dacrome/auth-server/tags","blobs_url":"https://api.github.com/repos/dacrome/auth-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dacrome/auth-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dacrome/auth-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/dacrome/auth-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dacrome/auth-server/statuses/{sha}","languages_url":"https://api.github.com/repos/dacrome/auth-server/languages","stargazers_url":"https://api.github.com/repos/dacrome/auth-server/stargazers","contributors_url":"https://api.github.com/repos/dacrome/auth-server/contributors","subscribers_url":"https://api.github.com/repos/dacrome/auth-server/subscribers","subscription_url":"https://api.github.com/repos/dacrome/auth-server/subscription","commits_url":"https://api.github.com/repos/dacrome/auth-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/dacrome/auth-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/dacrome/auth-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/dacrome/auth-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/dacrome/auth-server/contents/{+path}","compare_url":"https://api.github.com/repos/dacrome/auth-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dacrome/auth-server/merges","archive_url":"https://api.github.com/repos/dacrome/auth-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dacrome/auth-server/downloads","issues_url":"https://api.github.com/repos/dacrome/auth-server/issues{/number}","pulls_url":"https://api.github.com/repos/dacrome/auth-server/pulls{/number}","milestones_url":"https://api.github.com/repos/dacrome/auth-server/milestones{/number}","notifications_url":"https://api.github.com/repos/dacrome/auth-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dacrome/auth-server/labels{/name}","releases_url":"https://api.github.com/repos/dacrome/auth-server/releases{/id}","created_at":"2015-04-30T14:21:09Z","updated_at":"2015-04-30T14:21:10Z","pushed_at":"2015-09-08T20:24:20Z","git_url":"git://github.com/dacrome/auth-server.git","ssh_url":"git@github.com:dacrome/auth-server.git","clone_url":"https://github.com/dacrome/auth-server.git","svn_url":"https://github.com/dacrome/auth-server","homepage":null,"size":817,"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":"osiam:master","ref":"master","sha":"fbaca2ee3915d5b2f5cd4f08b3abbfb777e65c9f","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":34855687,"name":"auth-server","full_name":"osiam/auth-server","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/auth-server","description":"OSIAM auth-server","fork":false,"url":"https://api.github.com/repos/osiam/auth-server","forks_url":"https://api.github.com/repos/osiam/auth-server/forks","keys_url":"https://api.github.com/repos/osiam/auth-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/osiam/auth-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/osiam/auth-server/teams","hooks_url":"https://api.github.com/repos/osiam/auth-server/hooks","issue_events_url":"https://api.github.com/repos/osiam/auth-server/issues/events{/number}","events_url":"https://api.github.com/repos/osiam/auth-server/events","assignees_url":"https://api.github.com/repos/osiam/auth-server/assignees{/user}","branches_url":"https://api.github.com/repos/osiam/auth-server/branches{/branch}","tags_url":"https://api.github.com/repos/osiam/auth-server/tags","blobs_url":"https://api.github.com/repos/osiam/auth-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/osiam/auth-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/osiam/auth-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/osiam/auth-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/osiam/auth-server/statuses/{sha}","languages_url":"https://api.github.com/repos/osiam/auth-server/languages","stargazers_url":"https://api.github.com/repos/osiam/auth-server/stargazers","contributors_url":"https://api.github.com/repos/osiam/auth-server/contributors","subscribers_url":"https://api.github.com/repos/osiam/auth-server/subscribers","subscription_url":"https://api.github.com/repos/osiam/auth-server/subscription","commits_url":"https://api.github.com/repos/osiam/auth-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/osiam/auth-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/osiam/auth-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/osiam/auth-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/osiam/auth-server/contents/{+path}","compare_url":"https://api.github.com/repos/osiam/auth-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/osiam/auth-server/merges","archive_url":"https://api.github.com/repos/osiam/auth-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/osiam/auth-server/downloads","issues_url":"https://api.github.com/repos/osiam/auth-server/issues{/number}","pulls_url":"https://api.github.com/repos/osiam/auth-server/pulls{/number}","milestones_url":"https://api.github.com/repos/osiam/auth-server/milestones{/number}","notifications_url":"https://api.github.com/repos/osiam/auth-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/osiam/auth-server/labels{/name}","releases_url":"https://api.github.com/repos/osiam/auth-server/releases{/id}","created_at":"2015-04-30T13:25:15Z","updated_at":"2015-08-17T03:40:38Z","pushed_at":"2015-09-08T20:24:20Z","git_url":"git://github.com/osiam/auth-server.git","ssh_url":"git@github.com:osiam/auth-server.git","clone_url":"https://github.com/osiam/auth-server.git","svn_url":"https://github.com/osiam/auth-server","homepage":null,"size":1148,"stargazers_count":4,"watchers_count":4,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":16,"forks":6,"open_issues":16,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/osiam/auth-server/pulls/50"},"html":{"href":"https://github.com/osiam/auth-server/pull/50"},"issue":{"href":"https://api.github.com/repos/osiam/auth-server/issues/50"},"comments":{"href":"https://api.github.com/repos/osiam/auth-server/issues/50/comments"},"review_comments":{"href":"https://api.github.com/repos/osiam/auth-server/pulls/50/comments"},"review_comment":{"href":"https://api.github.com/repos/osiam/auth-server/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/osiam/auth-server/pulls/50/commits"},"statuses":{"href":"https://api.github.com/repos/osiam/auth-server/statuses/bd2c9da59fcb7f0aee16f4cc02b1368b042c2fcd"}}}}