Spring Java Configuration (JavaConfig) provides a pure-Java means of configuring the Spring IoC container. By taking advantage of Java 5.0 language features such as annotations and generics, JavaConfig allows users to express configuration logic and metadata directly in code, alleviating any need for XML.
Using Spring's Java Config, I need to acquire/instantiate a prototype-scoped bean with constructor arguments that are only obtainable at runtime. Consider the following code example (simplified for brevity):
@Autowired
private ApplicationContext…
I'm using Spring Security 3.2 and Spring 4.0.1
I'm working on converting an xml config into a Java config. When I annotate AuthenticationManager with @Autowired in my Filter, I'm getting an exception
Caused by:…
I have a spring boot web app with spring security configured. I want to disable authentication for a while (until needed).
I add this to the application.properties:
security.basic.enable: false
management.security.enabled: false
Here is some…
I'm trying to define access rules at method-level but it's not working what so ever.
SecurityConfiguration
@Configuration
@EnableWebSecurity
@EnableGlobalMethodSecurity(prePostEnabled = true)
public class SecurityConfiguration extends…
My main job does only read operations and the other one does some writing but on MyISAM engine which ignores transactions, so I wouldn't require necessarily transaction support. How can I configure Spring Batch to have its own datasource for the…
I'm new to Spring MVC framework and I have got an issue that I can not resolve by myself. Everything started when I integrated spring security with my application, after that all unicode values from HTML form were not encoded (spring security works…
I am trying to run a Junit functional test using Springs java-config for my application context. I am not sure if it is a problem with Spring or Junit... just not sure.. The application runs fine on my local server (hitting the db), but when I try…
I am using Spring-Security 3.2.0.RC2 with Java config.
I set up a simple HttpSecurity config that asks for basic auth on /v1/**.
GET requests work but POST requests fail with:
HTTP Status 403 - Invalid CSRF Token 'null' was found on the request…
What is the equivalent Java configuration for the Spring Security tag?
I tried
http.addFilter( new MyUsernamePasswordAuthenticationFilter() )
where the…
My project consists exposes two different parts, a JSF admin panel and a RESTfull service.
I am trying to setup spring security to use different authentication methods depending on the URL the user navigates.
The requirements are
Users navigating…
I am trying to secure a web application using Spring Security java configuration.
This is how the configuration looks:-
@Configuration
@EnableWebMvcSecurity
public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
private…
I'm trying to remove the "ROLE_" prefix in Spring Security. The first thing I tried was:
http.servletApi().rolePrefix("");
That didn't work, so I tried creating a BeanPostProcessor as suggested in…
what is the difference between
@Configuration
class ConfigA extends ConfigB {
//Some bean definitions here
}
and
@Configuration
@Import({ConfigB.class})
class ConfigA {
//Some bean definitions here
}
And also if we are importing multiple…
How can I define a custom Authentication provider by using Spring Security with Java Configurations?
I would like to perform a login checking credentials on my own database.
We are using weblogic version 12C. Steps to reproduce the issue: -
Create the datasource.
Deploy the application to weblogic.
Application works fine.
Update the deployed ear with the new one.
Application is not able to connect the…