Похожие чаты

Ok now i m starting with some newbie questions, sorry: -i

m building a web site using spring security, for now i m just mapping the permitted urls but the view can t render css and js. If i add the path of CSS to antmatcher, still not works. If i ignore JUST THOSE FOLDERS, spring security does not work at all (response from private urls allowed). Some advice?

-on stack, they said to work with xml, but using spring boot 3+, there is no xml configuration file. Am i right or am i missing something?

3 ответов

8 просмотров

you would do mapping to permitte css and js urls, i remeber that the order of permitted and block urls matters

Like @eduardo_asafe said, order matters: first you should specify more generic rules, and all futher rules override previous. Here's how my configuration for css/js/images looks like (it's grails, based on spring boot 1.5, but it's basically the same with syntax sugar). Note that spring security filter chains are also disabled for css/js/images: grails.plugin.springsecurity.controllerAnnotations.staticRules = [ [pattern: '/**', access: ['ROLE_USER']], // by default only users can access, subsequent rules override this ..... more specific patterns ..... [pattern: '/error', access: ['permitAll']], [pattern: '/assets/**', access: ['permitAll']], [pattern: '/**/js/**', access: ['permitAll']], [pattern: '/**/css/**', access: ['permitAll']], [pattern: '/**/images/**', access: ['permitAll']], [pattern: '/**/favicon.ico', access: ['permitAll']] ] grails.plugin.springsecurity.filterChain.chainMap = [ [pattern: '/assets/**', filters: 'none'], [pattern: '/**/js/**', filters: 'none'], [pattern: '/**/css/**', filters: 'none'], [pattern: '/**/images/**', filters: 'none'], [pattern: '/**/favicon.ico', filters: 'none'], [pattern: '/**', filters: 'JOINED_FILTERS'] ]

I guess, you're talking about spring boot 2+. I haven't worked with version 2, but official documentation says: https://docs.spring.io/spring-boot/docs/2.1.1.RELEASE/reference/htmlsingle/#using-boot-importing-xml-configuration

Похожие вопросы

Обсуждают сегодня

Господа, а что сейчас вообще с рынком труда на делфи происходит? Какова ситуация?
Rꙮman Yankꙮvsky
29
А вообще, что может смущать в самой Julia - бы сказал, что нет единого стандартного подхода по многим моментам, поэтому многое выглядит как "хаки" и произвол. Короче говоря, с...
Viktor G.
2
@Benzenoid can you tell me the easiest, and safest way to bu.y HEX now?
Živa Žena
20
This is a question from my wife who make a fortune with memes 😂😂 About the Migration and Tokens: 1. How will the old tokens be migrated to the new $LGCYX network? What is th...
🍿 °anton°
2
30500 за редактор? )
Владимир
47
а через ESC-код ?
Alexey Kulakov
29
What is the Dex situation? Agora team started with the Pnetwork for their dex which helped them both with integration. It’s completed but as you can see from the Pnetwork ann...
Ben
1
Гайс, вопрос для разносторонее развитых: читаю стрим с юарта, нада выделять с него фреймы с определенной структурой, если ли чо готовое, или долбаться с ринг буффером? нада у...
Vitaly
9
Anyone knows where there are some instructions or discort about failed bridge transactions ?
Jochem
21
@lozuk how do I get my phex copies of my ehex from a atomic wallet, to move to my rabby?
Justfrontin 👀
11
Карта сайта