Advertisement
Guest User

Untitled

a guest
May 25th, 2016
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.76 KB | None | 0 0
  1. http://localhost:8080/userapp/index.html#/login
  2.  
  3. protected void configure(HttpSecurity http) throws Exception {
  4. http
  5. .authorizeRequests()
  6. .antMatchers("/scripts/**").permitAll()
  7. .antMatchers("/styles/**").permitAll()
  8. .antMatchers("/index.html#/login").permitAll()
  9. .antMatchers("/index.html#/index").permitAll()
  10. .anyRequest().authenticated()
  11. .and()
  12. .formLogin()
  13. .usernameParameter("username")
  14. .passwordParameter("password")
  15. .loginPage("/index.html#/login")
  16. .permitAll()
  17. .and()
  18. .exceptionHandling()
  19. .accessDeniedPage("/Access_Denied")
  20. .and()
  21. .csrf()
  22. .disable();
  23.  
  24. }
  25.  
  26. <div class="jumbotron">
  27. <div class="container">
  28. <div class="col-sm-8 col-sm-offset-2">
  29. <div ng-class="{ 'alert': flash, 'alert-success': flash.type === 'success', 'alert-danger': flash.type === 'error' }" ng-if="flash" ng-bind="flash.message"></div>
  30. <div ng-view></div>
  31. </div>
  32. </div>
  33. </div>
  34.  
  35. function config($routeProvider, $httpProvider) {
  36. $routeProvider.when('/index', {
  37. controller: 'HomeController',
  38. templateUrl: 'home.view.html',
  39. controllerAs: 'vm'
  40. })
  41. .when('/login', {
  42. controller: 'LoginController',
  43. templateUrl: 'login.view.html',
  44. controllerAs: 'vm'
  45. })
  46. .otherwise({
  47. redirectTo: '/login'
  48. });
  49. $httpProvider.defaults.headers.common["X-Requested-With"] = 'XMLHttpRequest';
  50. }
  51. config.$inject = [
  52. '$routeProvider', '$httpProvider'
  53. ];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement