Похожие чаты

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 ответов

3 просмотра

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

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

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

Есть какой-нибудь для Delphi/FPC T*Compression(Decompression)Stream на базе LZ4/Zstd/любой другой быстрый(и хорошо сжимающий) алгоритм А ещё лучше в pure pascal А ещё лучше од...
notme
48
Ясн. Но я всеравно к кедам отношусь с опасением. Чисто субьективное кедосозерцание. Что касаемо "восторга изяшности кед" так и не вкурил, хотя много слышал, пока не поставил с...
Артем Записной
30
А чем вам питонисты не угодили?😂
.
79
type TObj = object procedure Init; virtual; end; TObj1 = object(TObj) procedure Init; override; end; procedure TObj1.Init; begin inherited; end; procedur...
Alexander 👋
29
Hey guys, did you see the new announcement about $Fun? 🔥
Filip Murphy
55
Такой вопросец - есть функция function MySuperDuperConcat(const a: array of AnsiString): AnsiString; Как мне в её теле сделать вот так? Result:=Concat(a); А не грустный вариан...
notme
15
[c8] what's the best looking best ux mobile wallet in crypto?
DiscordBridge
12
They keep hyping $FUN but where's the progress? 🙄
Noah Noure
23
Btw guys very stupid question but i haven't researchd so js asking you pros . Can ltc be traced too? Literally point to pint to the user? And getting the banks blocked ? Exch...
20
Can I deposit from Bingx-exchange to wazirx? Any problem? Admin
Crypto Alt Trader
16
Карта сайта