2016-03-23 69 views
0

我正在使用AngularJs和Spring Security4创建一个登录页面,使用 https://github.com/spring-guides/tut-spring-security-and-angular-js/tree/master/single。 一切工作良好,到目前为止,除了当我在hello.jsAngularJS + Spring Security + Weblogic 12

var headers = credentials ? {authorization : "Basic " 
     + btoa(credentials.username + ":" + credentials.password) 
    } : {}; 

使用下面的代码它发出了401,这是正确的,但它也发送响应头 - WWW验证:基本领域=“weblogic”

打开弹出窗口。我怎样才能发送401,但删除标题。

注:我已经在文章中使用下面的代码作为提 $httpProvider.defaults.headers.common["X-Requested-With"] = 'XMLHttpRequest';

回答

0

使用下面的config.xml中

<security-configuration> 
<enforce-valid-basic-auth-credentials>false</enforce-valid-basic-auth-credentials> 
</security-configuration>