{"action":"created","issue":{"url":"https://api.github.com/repos/spring-projects/spring-security/issues/4857","repository_url":"https://api.github.com/repos/spring-projects/spring-security","labels_url":"https://api.github.com/repos/spring-projects/spring-security/issues/4857/labels{/name}","comments_url":"https://api.github.com/repos/spring-projects/spring-security/issues/4857/comments","events_url":"https://api.github.com/repos/spring-projects/spring-security/issues/4857/events","html_url":"https://github.com/spring-projects/spring-security/issues/4857","id":275963713,"number":4857,"title":"can not load css and js","user":{"login":"zhangbin","id":1757739,"avatar_url":"https://avatars1.githubusercontent.com/u/1757739?v=4","gravatar_id":"","url":"https://api.github.com/users/zhangbin","html_url":"https://github.com/zhangbin","followers_url":"https://api.github.com/users/zhangbin/followers","following_url":"https://api.github.com/users/zhangbin/following{/other_user}","gists_url":"https://api.github.com/users/zhangbin/gists{/gist_id}","starred_url":"https://api.github.com/users/zhangbin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhangbin/subscriptions","organizations_url":"https://api.github.com/users/zhangbin/orgs","repos_url":"https://api.github.com/users/zhangbin/repos","events_url":"https://api.github.com/users/zhangbin/events{/privacy}","received_events_url":"https://api.github.com/users/zhangbin/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-11-22T07:02:28Z","updated_at":"2017-11-22T08:18:47Z","closed_at":"2017-11-22T08:18:12Z","author_association":"NONE","body":"I am sorry, English is not my first language. If you do not understand, please send email to me, zhangbin.zj@gmail.com. Thanks.\r\n### Summary\r\n\r\n\r\nwhen I use spring boot and spring security, the web application can not load css and js success\r\n\r\n\r\n### Actual Behavior\r\nI use spring boot and spring security, and I put my css and js files in \"/resources/static/css\", \"/resources/static/css\",I use UserDetailsService to load user by username.\r\nNow, when I request css , it can not load success, it redirect to \"index\" page\r\n\r\ncode: \r\n- config:\r\nhttps://github.com/zhangbin/infos/blob/master/src/main/java/work/variety/infos/config/SecurityConfig.java\r\n- pom:\r\nhttps://github.com/zhangbin/infos/blob/master/pom.xml\r\n\r\n### Configuration\r\n\r\ndependency\r\n```java\r\n\r\n<dependency>\r\n    <groupId>org.springframework.boot</groupId>\r\n    <artifactId>spring-boot-starter-security</artifactId>\r\n</dependency>\r\n```\r\nsecurityConfig\r\n```java\r\n\r\n@Configuration\r\n@EnableWebSecurity\r\npublic class SecurityConfig extends WebSecurityConfigurerAdapter {\r\n    @Autowired\r\n    private UserDetailsService userDetailsService;\r\n\r\n    @Bean\r\n    public BCryptPasswordEncoder bCryptPasswordEncoder() {\r\n        return new BCryptPasswordEncoder();\r\n    }\r\n\r\n    @Override\r\n    protected void configure(HttpSecurity http) throws Exception {\r\n        http\r\n                .authorizeRequests()\r\n                .antMatchers(HttpMethod.GET, \"/css/**\", \"/js/**\",\"/fonts/**\",\"/**/favicon.ico\", \"/about\").permitAll()\r\n                .antMatchers(\"/infos/**\").hasRole(\"USER\")\r\n                .and()\r\n                .formLogin().passwordParameter(\"password\").usernameParameter(\"phone\")\r\n                .successForwardUrl(\"/index\")\r\n                .loginPage(\"/login\").failureUrl(\"/login-error\");\r\n    }\r\n\r\n    @Autowired\r\n    public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {\r\n        auth.userDetailsService(userDetailsService).passwordEncoder(bCryptPasswordEncoder());\r\n    }\r\n}\r\n\r\n```\r\n\r\n### Version\r\n\r\nspring boot version:1.5.8\r\nspring-boot-starter-security version: 1.5.8\r\nspring security version:4.2.3 \r\n\r\n### Sample\r\n\r\n<!--\r\nProviding a complete sample (i.e. link to a github repository) will give this issue higher\r\npriority than issues that do not have a complete sample\r\n-->\r\n"},"comment":{"url":"https://api.github.com/repos/spring-projects/spring-security/issues/comments/346275658","html_url":"https://github.com/spring-projects/spring-security/issues/4857#issuecomment-346275658","issue_url":"https://api.github.com/repos/spring-projects/spring-security/issues/4857","id":346275658,"user":{"login":"zhangbin","id":1757739,"avatar_url":"https://avatars1.githubusercontent.com/u/1757739?v=4","gravatar_id":"","url":"https://api.github.com/users/zhangbin","html_url":"https://github.com/zhangbin","followers_url":"https://api.github.com/users/zhangbin/followers","following_url":"https://api.github.com/users/zhangbin/following{/other_user}","gists_url":"https://api.github.com/users/zhangbin/gists{/gist_id}","starred_url":"https://api.github.com/users/zhangbin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhangbin/subscriptions","organizations_url":"https://api.github.com/users/zhangbin/orgs","repos_url":"https://api.github.com/users/zhangbin/repos","events_url":"https://api.github.com/users/zhangbin/events{/privacy}","received_events_url":"https://api.github.com/users/zhangbin/received_events","type":"User","site_admin":false},"created_at":"2017-11-22T08:18:46Z","updated_at":"2017-11-22T08:18:46Z","author_association":"NONE","body":"it`s ok,my ide's reason"}}
{"actor":{"display_login":"zhangbin"}}