mercredi 15 avril 2015

Spring Security + AngularJS + Permissions: disabling all pages for non authenticated users other than login

I want that users have to login before seeing other pages. If they try to access some other page, they have to login first.


I tried using the following, but it keeps giving me an HTTP Status 401 - Access Denied error.



http.csrf().disable().exceptionHandling()
.authenticationEntryPoint(unauthorizedHandler).and()
.formLogin().loginPage("/login").successHandler(authSuccess)
.failureHandler(authFailure).and().authorizeRequests()
.antMatchers("/login", "/#/login", "/login.html", "/login.jsp", "login", "/login")
.permitAll().anyRequest().authenticated();


Since I am using angularjs, it might have to be something with that. I however still tried to add the /#/login part, but still without any good result.


Aucun commentaire:

Enregistrer un commentaire