Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/spring-boot/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用数据库、Spring引导和Restful Web服务进行基本身份验证?_Spring_Spring Boot_Spring Security_Basic Authentication_Restful Authentication - Fatal编程技术网

如何使用数据库、Spring引导和Restful Web服务进行基本身份验证?

如何使用数据库、Spring引导和Restful Web服务进行基本身份验证?,spring,spring-boot,spring-security,basic-authentication,restful-authentication,Spring,Spring Boot,Spring Security,Basic Authentication,Restful Authentication,我已经用Spring引导、Spring数据JPA、基本身份验证和RESTFul Web服务完成了服务器端应用程序 当我进行身份验证(登录-http://localhost:8080/server-侧面/登录或注销http://localhost:8080/server-侧边/注销)从我的客户端应用程序(AngularJS) 但如果我提供了错误的登录凭据,我的浏览器会要求输入登录凭据 但我希望它必须由我的应用程序处理,而不是由我的浏览器处理 我遵循教程修复了我的问题,在我的BasicAuthent

我已经用Spring引导、Spring数据JPA、基本身份验证和RESTFul Web服务完成了服务器端应用程序

当我进行身份验证(登录-
http://localhost:8080/server-侧面/登录
或注销http://localhost:8080/server-侧边/注销)从我的客户端应用程序(AngularJS)

但如果我提供了错误的登录凭据,我的浏览器会要求输入登录凭据

但我希望它必须由我的应用程序处理,而不是由我的浏览器处理


我遵循教程

修复了我的问题,在我的BasicAuthenticationEntryPoint.java中添加了以下代码,因为目前我是从“表单”登录的。setHeader(“WWW-Authenticate”、“FormBased”);但如果我不是从“表单”登录,我需要解决方案