【问题标题】:How does the $http angular request pass the Spring Boot Security check?$http 角度请求如何通过 Spring Boot 安全检查?
【发布时间】:2016-10-04 05:40:34
【问题描述】:

我正在阅读本教程:

https://spring.io/guides/tutorials/spring-security-and-angular-js/

作者证明这行不通:

$ curl localhost:8080/resource
{"timestamp":1420442772928,"status":401,"error":"Unauthorized","message":"Full authentication is required to access this resource","path":"/resource"}

在以下部分中,作者生成了这个 sn-p:

    angular.module('hello', [])
      .controller('home', function($http) {
      var self = this;
      $http.get('/resource/').then(function(response) {
        self.greeting = response.data;
      })
    });

并表示能够获取数据。我的问题是那个sn-p是怎么通过安全检查的?

TIA, 奥莱

【问题讨论】:

    标签: angularjs spring-security spring-boot


    【解决方案1】:

    我再次阅读并意识到它使用基本身份验证。 Spring Boot 使用用户 user 和打印在控制台上的密码或在 src/main/resources/application.properties 中配置的密码以及 security.user.password=password 条目。

    【讨论】:

      猜你喜欢
      • 2020-10-20
      • 2022-10-07
      • 1970-01-01
      • 2021-02-13
      • 2021-11-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多