messaging-sample's Introduction
messaging-sample's People
Forkers
lucky72o c0demark ramu81 abhishek09 steve-todorov kuc0229 alwyn malathidhandapani umeshrama santhoshbonala rajtestjava431 abhishekvats007 mihango awais16 jihyunle thiagotgo90 theheapdump nitisharyan ylcolala ravimukti freedom0309 keeplearningandtryingmessaging-sample's Issues
web.ignoring() static assets
Hi,
I am in the process of learning about Spring Security and have been playing with this project after seeing your presentation on YouTube. I have a query about cutting down the processing of static assets.
I have seen in another blog post that in a WebSecurityConfigurerAdapter
class you can override the configure
method like this:
@Override
public void configure(WebSecurity web) {
web.ignoring().mvcMatchers(...);
}
Doing this (I believe) means you can skip the whole filter chain process for specified paths. Am I correct in thinking this would be more efficient?
If so I have had a couple of issues implementing this. I created a new WebSecurityConfigurerAdapter
and specified it as the first one to be processed:
@Configuration
@Order(1)
public static class SkipSecurityConfig extends WebSecurityConfigurerAdapter {
@Override
public void configure(WebSecurity web) {
web.ignoring().mvcMatchers("/assets/**", "/webjars/**");
}
}
I also removed the .antMatchers("/assets/**", "/webjars/**").permitAll()
lines from both other WebSecurityConfigurerAdapter
classes (leaving in .antMatchers("/").permitAll()
in AppSecurityConfig
).
This succeeds in clearing the filter chain if I go to specific resources directly like http://localhost:8080/assets/img/logo.png
but breaks the other WebSecurityConfigurerAdapter
classes as they no longer seem to be picked up.
Is this a valid thing to be doing and if so how should it be implemented to ensure the 2 existing filter chains work as expected?
Thanks,
David.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.