spring-guides / tut-spring-security-and-angular-js

Spring Security and Angular:: A tutorial on how to use Spring Security with a single page application with various backend architectures, ranging from a simple single server to an API gateway with OAuth2 authentication.
https://spring.io/guides/tutorials/spring-security-and-angular-js/
1.69k stars 1.64k forks source link

Angular static resource js&css issues #181

Open towardsfuture opened 6 years ago

towardsfuture commented 6 years ago

While request static js&css(eg. main.js,polyfills.js etc) from ui. The url of main.js is not 'http://localhost:8080/ui/main.js' but 'http://localhost:8080/main.js'.

dsyer commented 5 years ago

Correct. Is there a an error in the text somewhere?

towardsfuture commented 5 years ago

Because the new angular compiled file's name not composed with 'bundle' any more.

dsyer commented 5 years ago

That seems like a different issue?

towardsfuture commented 5 years ago

Yes,it cause by the new angular version.

matohl commented 5 years ago

Just update the method ignoring static resources from authentication to:

       @Override
    public void configure(WebSecurity web) throws Exception {
        web.ignoring().antMatchers("/favicon.ico",
                "/polyfills.js*",
                "/runtime.js*",
                "/styles.js*",
                "/scripts.js",
                "/main.js*",
                "/vendor.js*"
        );
    }