cleanup work
This commit is contained in:
parent
1455c3813f
commit
91a63c4ea8
|
@ -67,8 +67,8 @@
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<!-- Spring -->
|
<!-- Spring -->
|
||||||
<org.springframework.version>4.1.7.RELEASE</org.springframework.version>
|
<org.springframework.version>4.2.2.RELEASE</org.springframework.version>
|
||||||
<org.springframework.security.version>3.2.8.RELEASE</org.springframework.security.version>
|
<org.springframework.security.version>4.0.3.RELEASE</org.springframework.security.version>
|
||||||
<oauth.version>2.0.7.RELEASE</oauth.version>
|
<oauth.version>2.0.7.RELEASE</oauth.version>
|
||||||
|
|
||||||
<!-- marshalling -->
|
<!-- marshalling -->
|
||||||
|
|
|
@ -8,12 +8,14 @@ import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.context.annotation.PropertySource;
|
import org.springframework.context.annotation.PropertySource;
|
||||||
import org.springframework.core.env.Environment;
|
import org.springframework.core.env.Environment;
|
||||||
import org.springframework.jdbc.datasource.DriverManagerDataSource;
|
import org.springframework.jdbc.datasource.DriverManagerDataSource;
|
||||||
|
import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer;
|
||||||
import org.springframework.security.oauth2.provider.token.TokenStore;
|
import org.springframework.security.oauth2.provider.token.TokenStore;
|
||||||
import org.springframework.security.oauth2.provider.token.store.JdbcTokenStore;
|
import org.springframework.security.oauth2.provider.token.store.JdbcTokenStore;
|
||||||
|
|
||||||
@Configuration
|
@Configuration
|
||||||
@PropertySource({ "classpath:persistence.properties" })
|
@PropertySource({ "classpath:persistence.properties" })
|
||||||
public class OAuth2ResourceConfig {
|
@EnableResourceServer
|
||||||
|
public class OAuth2ResourceServerConfig {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private Environment env;
|
private Environment env;
|
|
@ -5,7 +5,6 @@ import static org.apache.commons.lang3.RandomStringUtils.randomNumeric;
|
||||||
|
|
||||||
import org.baeldung.web.dto.Foo;
|
import org.baeldung.web.dto.Foo;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer;
|
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
@ -13,7 +12,6 @@ import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
@EnableResourceServer
|
|
||||||
public class FooController {
|
public class FooController {
|
||||||
|
|
||||||
public FooController() {
|
public FooController() {
|
||||||
|
|
|
@ -26,7 +26,7 @@ import org.springframework.security.oauth2.provider.token.store.JdbcTokenStore;
|
||||||
@Configuration
|
@Configuration
|
||||||
@PropertySource({ "classpath:persistence.properties" })
|
@PropertySource({ "classpath:persistence.properties" })
|
||||||
@EnableAuthorizationServer
|
@EnableAuthorizationServer
|
||||||
public class AuthServerOAuth2Config extends AuthorizationServerConfigurerAdapter {
|
public class OAuth2AuthorizationServerConfig extends AuthorizationServerConfigurerAdapter {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private Environment env;
|
private Environment env;
|
|
@ -23,13 +23,13 @@ public class ServerSecurityConfig extends WebSecurityConfigurerAdapter {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void configure(HttpSecurity http) throws Exception {
|
protected void configure(final HttpSecurity http) throws Exception {
|
||||||
// @formatter:off
|
// @formatter:off
|
||||||
http.authorizeRequests()
|
http.authorizeRequests()
|
||||||
.antMatchers("/login").permitAll()
|
.antMatchers("/login").permitAll()
|
||||||
.anyRequest().authenticated()
|
.anyRequest().authenticated()
|
||||||
.and()
|
// .and().formLogin().permitAll()
|
||||||
.formLogin().permitAll();
|
;
|
||||||
// @formatter:on
|
// @formatter:on
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,8 +6,13 @@
|
||||||
</projects>
|
</projects>
|
||||||
<buildSpec>
|
<buildSpec>
|
||||||
<buildCommand>
|
<buildCommand>
|
||||||
<name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
|
<name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
|
||||||
|
<triggers>full,incremental,</triggers>
|
||||||
<arguments>
|
<arguments>
|
||||||
|
<dictionary>
|
||||||
|
<key>LaunchConfigHandle</key>
|
||||||
|
<value><project>/.externalToolBuilders/org.eclipse.wst.jsdt.core.javascriptValidator (1).launch</value>
|
||||||
|
</dictionary>
|
||||||
</arguments>
|
</arguments>
|
||||||
</buildCommand>
|
</buildCommand>
|
||||||
<buildCommand>
|
<buildCommand>
|
||||||
|
|
Loading…
Reference in New Issue