Security exceptions

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;







up vote
2
down vote

favorite












I'm trying to configure security exceptions to all JavaScript/CSS of my pages.



I need to login to access the JSP files, except the login page, but all pages needs your resources so the folders must be access-free.



.csrf().disable()
.authorizeRequests()
.antMatchers("/login*").anonymous()
.antMatchers("/bower_components/**").permitAll()
.antMatchers("/custom/**").permitAll()
.antMatchers("/plugins/**").permitAll()
.antMatchers("/dist/**").permitAll()
.anyRequest().authenticated()
.and()

.formLogin()
.loginPage("/loginPage")
.defaultSuccessUrl("/home", true)
.failureUrl("/loginPage?error=true")
.loginProcessingUrl("/login")
.usernameParameter("username")
.passwordParameter("password")
.and()

.logout()
.logoutSuccessUrl("/loginPage")
.invalidateHttpSession(true);






share|improve this question





















  • Hi Jamal. The text has lost its meaning / purpose when you removed the the code seems ugly part of original question. I need to know if the code in question is as elegant as possible and without the original text the users may not know what I mean. Someone may flag as obscure...
    – Magno C
    May 3 at 1:17

















up vote
2
down vote

favorite












I'm trying to configure security exceptions to all JavaScript/CSS of my pages.



I need to login to access the JSP files, except the login page, but all pages needs your resources so the folders must be access-free.



.csrf().disable()
.authorizeRequests()
.antMatchers("/login*").anonymous()
.antMatchers("/bower_components/**").permitAll()
.antMatchers("/custom/**").permitAll()
.antMatchers("/plugins/**").permitAll()
.antMatchers("/dist/**").permitAll()
.anyRequest().authenticated()
.and()

.formLogin()
.loginPage("/loginPage")
.defaultSuccessUrl("/home", true)
.failureUrl("/loginPage?error=true")
.loginProcessingUrl("/login")
.usernameParameter("username")
.passwordParameter("password")
.and()

.logout()
.logoutSuccessUrl("/loginPage")
.invalidateHttpSession(true);






share|improve this question





















  • Hi Jamal. The text has lost its meaning / purpose when you removed the the code seems ugly part of original question. I need to know if the code in question is as elegant as possible and without the original text the users may not know what I mean. Someone may flag as obscure...
    – Magno C
    May 3 at 1:17













up vote
2
down vote

favorite









up vote
2
down vote

favorite











I'm trying to configure security exceptions to all JavaScript/CSS of my pages.



I need to login to access the JSP files, except the login page, but all pages needs your resources so the folders must be access-free.



.csrf().disable()
.authorizeRequests()
.antMatchers("/login*").anonymous()
.antMatchers("/bower_components/**").permitAll()
.antMatchers("/custom/**").permitAll()
.antMatchers("/plugins/**").permitAll()
.antMatchers("/dist/**").permitAll()
.anyRequest().authenticated()
.and()

.formLogin()
.loginPage("/loginPage")
.defaultSuccessUrl("/home", true)
.failureUrl("/loginPage?error=true")
.loginProcessingUrl("/login")
.usernameParameter("username")
.passwordParameter("password")
.and()

.logout()
.logoutSuccessUrl("/loginPage")
.invalidateHttpSession(true);






share|improve this question













I'm trying to configure security exceptions to all JavaScript/CSS of my pages.



I need to login to access the JSP files, except the login page, but all pages needs your resources so the folders must be access-free.



.csrf().disable()
.authorizeRequests()
.antMatchers("/login*").anonymous()
.antMatchers("/bower_components/**").permitAll()
.antMatchers("/custom/**").permitAll()
.antMatchers("/plugins/**").permitAll()
.antMatchers("/dist/**").permitAll()
.anyRequest().authenticated()
.and()

.formLogin()
.loginPage("/loginPage")
.defaultSuccessUrl("/home", true)
.failureUrl("/loginPage?error=true")
.loginProcessingUrl("/login")
.usernameParameter("username")
.passwordParameter("password")
.and()

.logout()
.logoutSuccessUrl("/loginPage")
.invalidateHttpSession(true);








share|improve this question












share|improve this question




share|improve this question








edited May 3 at 0:45









Jamal♦

30.1k11114225




30.1k11114225









asked May 2 at 14:15









Magno C

1115




1115











  • Hi Jamal. The text has lost its meaning / purpose when you removed the the code seems ugly part of original question. I need to know if the code in question is as elegant as possible and without the original text the users may not know what I mean. Someone may flag as obscure...
    – Magno C
    May 3 at 1:17

















  • Hi Jamal. The text has lost its meaning / purpose when you removed the the code seems ugly part of original question. I need to know if the code in question is as elegant as possible and without the original text the users may not know what I mean. Someone may flag as obscure...
    – Magno C
    May 3 at 1:17
















Hi Jamal. The text has lost its meaning / purpose when you removed the the code seems ugly part of original question. I need to know if the code in question is as elegant as possible and without the original text the users may not know what I mean. Someone may flag as obscure...
– Magno C
May 3 at 1:17





Hi Jamal. The text has lost its meaning / purpose when you removed the the code seems ugly part of original question. I need to know if the code in question is as elegant as possible and without the original text the users may not know what I mean. Someone may flag as obscure...
– Magno C
May 3 at 1:17
















active

oldest

votes











Your Answer




StackExchange.ifUsing("editor", function ()
return StackExchange.using("mathjaxEditing", function ()
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["\$", "\$"]]);
);
);
, "mathjax-editing");

StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "196"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);








 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodereview.stackexchange.com%2fquestions%2f193467%2fsecurity-exceptions%23new-answer', 'question_page');

);

Post as a guest



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes










 

draft saved


draft discarded


























 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodereview.stackexchange.com%2fquestions%2f193467%2fsecurity-exceptions%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

Python Lists

Aion

JavaScript Array Iteration Methods