Commit a46a75cb authored by Daniel Gerhardt's avatar Daniel Gerhardt

Enable AspectJ for Spring Security aspects

parent d486835a
...@@ -148,6 +148,10 @@ ...@@ -148,6 +148,10 @@
<artifactId>spring-integration-mail</artifactId> <artifactId>spring-integration-mail</artifactId>
</dependency> </dependency>
<!-- Security --> <!-- Security -->
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-aspects</artifactId>
</dependency>
<dependency> <dependency>
<groupId>org.springframework.security</groupId> <groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId> <artifactId>spring-security-config</artifactId>
...@@ -340,6 +344,10 @@ ...@@ -340,6 +344,10 @@
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId> <artifactId>spring-aspects</artifactId>
</aspectLibrary> </aspectLibrary>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-aspects</artifactId>
</dependency>
</aspectLibraries> </aspectLibraries>
<showWeaveInfo>true</showWeaveInfo> <showWeaveInfo>true</showWeaveInfo>
</configuration> </configuration>
......
...@@ -35,6 +35,7 @@ import org.slf4j.Logger; ...@@ -35,6 +35,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.AdviceMode;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile; import org.springframework.context.annotation.Profile;
...@@ -83,7 +84,7 @@ import java.util.List; ...@@ -83,7 +84,7 @@ import java.util.List;
* Loads property file and configures components used for authentication. * Loads property file and configures components used for authentication.
*/ */
@Configuration @Configuration
@EnableGlobalMethodSecurity(prePostEnabled = true) @EnableGlobalMethodSecurity(mode = AdviceMode.ASPECTJ, prePostEnabled = true)
@EnableWebSecurity @EnableWebSecurity
@Profile("!test") @Profile("!test")
public class SecurityConfig extends WebSecurityConfigurerAdapter { public class SecurityConfig extends WebSecurityConfigurerAdapter {
......
...@@ -22,6 +22,7 @@ import org.jasig.cas.client.validation.Cas20ProxyTicketValidator; ...@@ -22,6 +22,7 @@ import org.jasig.cas.client.validation.Cas20ProxyTicketValidator;
import org.pac4j.oauth.client.FacebookClient; import org.pac4j.oauth.client.FacebookClient;
import org.pac4j.oauth.client.Google2Client; import org.pac4j.oauth.client.Google2Client;
import org.pac4j.oauth.client.TwitterClient; import org.pac4j.oauth.client.TwitterClient;
import org.springframework.context.annotation.AdviceMode;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile; import org.springframework.context.annotation.Profile;
...@@ -38,7 +39,7 @@ import org.springframework.security.core.session.SessionRegistry; ...@@ -38,7 +39,7 @@ import org.springframework.security.core.session.SessionRegistry;
import org.springframework.security.core.session.SessionRegistryImpl; import org.springframework.security.core.session.SessionRegistryImpl;
@Configuration @Configuration
@EnableGlobalMethodSecurity(prePostEnabled = true) @EnableGlobalMethodSecurity(mode = AdviceMode.ASPECTJ, prePostEnabled = true)
@EnableWebSecurity @EnableWebSecurity
@Profile("test") @Profile("test")
public class TestSecurityConfig extends SecurityConfig { public class TestSecurityConfig extends SecurityConfig {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment