0
votes

I want to map local folder to localhost:8080 How can I achieve this. I am using spring boot. have given permitall to public/pic folder.

how to open in browser like below.

http://localhost:8080/public/pic/default.jpg

above link gives 401 and asks for username and password.

using below code for security in spring

@Override
    protected void configure (HttpSecurity http) throws Exception {

        http.csrf().disable();
        http.cors().disable();
        http.authorizeRequests()
                .antMatchers("/public/pic/**").permitAll()
                .anyRequest().authenticated()
            .and()
                .httpBasic()
            .and()
                .logout();
        // @formatter:on
    }

where should be the folder /public/pic in local system?

1
found the solution here stackoverflow.com/questions/24916894/…Anjali

1 Answers

0
votes

Try to add to your config

@Override
public void configure(WebSecurity webSecurity) {
    webSecurity.ignoring().antMatchers("/public/pic/**");
}