AngularJS and Spring Security Problem (ERR_TOO_MANY_REDIRECTS)

705 views
Skip to first unread message

Michael Zerna

unread,
Feb 26, 2013, 7:06:12 AM2/26/13
to ang...@googlegroups.com
Hey Folks,

First of all, I would like to thank everyone in this community for the great time i have with AngularJS.

At the moment i have a problem with Spring Security and AngularJS. I want to handle a costum authentication, but i got a "Error310 (net::ERR_TOO_MANY_REDIRECTS)".
Did anyone has a solution for me?

security.xml
<security:http auto-config="true">
        <security:intercept-url pattern="/**" access="ROLE_USER"/>
        <security:form-login login-page="/login" />
    </security:http>
    <security:authentication-manager>
        <security:authentication-provider>
            <security:user-service>
                <security:user name="user1" password="user1" authorities="ROLE_USER" />
            </security:user-service>
        </security:authentication-provider>
    </security:authentication-manager>

app.js
var testApp = angular.module('testApp', [])
  .config(['$routeProvider', function($routeProvider) {
    $routeProvider
      .when('/main', {
        templateUrl: 'views/main.html',
        controller: 'MainCtrl'
      })
        .when('/login',{
            templateUrl:'views/login.html',
            controller: 'LoginCtrl'
        })
      .otherwise({
        redirectTo: '/login'
      });
  }]); 

Thank you in advance and greetings from Berlin  
Reply all
Reply to author
Forward
0 new messages