Enable and allow access to h2-console

This commit is contained in:
Dario Seidl 2018-04-01 22:50:30 +02:00
parent 3f7a756746
commit 7e9b018d7e
2 changed files with 7 additions and 2 deletions

View File

@ -36,7 +36,11 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
.antMatchers(HttpMethod.GET, "/articles/feed").authenticated() .antMatchers(HttpMethod.GET, "/articles/feed").authenticated()
.antMatchers(HttpMethod.POST, "/users", "/users/login").permitAll() .antMatchers(HttpMethod.POST, "/users", "/users/login").permitAll()
.antMatchers(HttpMethod.GET, "/articles/**", "/profiles/**", "/tags").permitAll() .antMatchers(HttpMethod.GET, "/articles/**", "/profiles/**", "/tags").permitAll()
.anyRequest().authenticated(); .antMatchers("/h2-console", "/h2-console/**")
.permitAll()
.anyRequest().authenticated()
.and()
.headers().frameOptions().sameOrigin();
http.addFilterBefore(jwtTokenFilter(), UsernamePasswordAuthenticationFilter.class); http.addFilterBefore(jwtTokenFilter(), UsernamePasswordAuthenticationFilter.class);
} }

View File

@ -4,4 +4,5 @@ jwt.secret=nRvyYC4soFxBdZ-F-5Nnzz5USXstR1YylsTd-mA0aKtI9HUlriGrtkf-TiuDapkLiUCog
jwt.sessionTime=86400 jwt.sessionTime=86400
mybatis.config-location=classpath:mybatis-config.xml mybatis.config-location=classpath:mybatis-config.xml
mybatis.mapper-locations=mapper/*.xml mybatis.mapper-locations=mapper/*.xml
logging.level.io.spring.infrastructure.mybatis.readservice.ArticleReadService=DEBUG logging.level.io.spring.infrastructure.mybatis.readservice.ArticleReadService=DEBUG
spring.h2.console.enabled=true