我正在尝试使用Spring Security Java配置保护Web应用程序的安全。

这是配置的样子:

@Configuration

@EnableWebMvcSecurity

public class SecurityConfiguration extends WebSecurityConfigurerAdapter {

private String googleClientSecret;

@Autowired

private CustomUserService customUserService;

/*

* (non-Javadoc)

*

* @see org.springframework.security.config.annotation.web.configuration.

* WebSecurityConfigurerAdapter

* #configure(org.springframework.security.config

* .annotation.web.builders.HttpSecurity)

*/

@Override

protected void configure(HttpSecurity http) throws Exception {

// @formatter:off

http

.authorizeRequests()

.antMatchers(HttpMethod.GET, "/","/static/**", "/resources/**","/resources/public/**").permitAll()

.anyRequest().authenticated()

.and()

.formLogin()

.and()

.httpBasic().disable()

.requiresChannel().anyRequest().requiresSecure();

// @formatter:on

super.configure(http);

}

@Override

protected void configure(AuthenticationManagerBuilder auth)

throws Exception {

// @formatter:off

auth

.eraseCredentials(true)

.userDetailsService(customUserService);

// @formatter:on

super.configure(auth);

}

}

请注意,我已使用以下命令明确禁用了HTTP基本身份验证:

.httpBasic().disable()

访问安全的URL时,我仍然收到HTTP Authenticaton提示框。为什么?

请帮我解决这个问题。我只想呈现捆绑的默认登录表单。

Spring Boot Starter版本:1.1.5 Spring安全版本:3.2.5

java取消 验证_使用Spring Security Java配置时禁用基本身份验证相关推荐

  1. java授权失败_自定义Spring Security的身份验证失败处理方法

    1.概述 在本快速教程中,我们将演示如何在Spring Boot应用程序中自定义Spring Security的身份验证失败处理.目标是使用表单登录方法对用户进行身份验证. 2.认证和授权(Authe ...

  2. java spring 登录验证_浅析Spring Security登录验证流程源码

    一.登录认证基于过滤器链 Spring Security的登录验证流程核心就是过滤器链.当一个请求到达时按照过滤器链的顺序依次进行处理,通过所有过滤器链的验证,就可以访问API接口了. SpringS ...

  3. java邮件支持_使用Spring的JAVA Mail支持简化邮件发送功能

    闲来无事,翻看<Spring in Action>,发现Spring集成了对JAVA Mail的支持,有点小激动的看了一遍,嗯,话说真的简单了很多. Spring的邮件发送的核心是Mail ...

  4. aws 短信验证_在AWS Kubernetes上进行抛光的rshiny身份验证

    aws 短信验证 If you're looking for a hassle free way to add authentication to your RShiny Apps you shoul ...

  5. sqlserver去掉密码强度验证_安装sql2008数据库引擎配置时,提示sa密码强度不满足要求怎么办?...

    展开全部 设置带有数字,符号,大写字母,小写字母,还有8个位数以上的密码 Microsoft SQL Server2008安装配置过程:e69da5e887aa32313133353236313431 ...

  6. java 序列化异常_关于spring:Java序列化异常消息

    在本机上本地运行应用程序时,该应用程序可以完美运行. 部署到质量检查程序后,会收到以下错误. 我正在本地和QA中运行Tomcat 5.5.23. 该应用程序还使用Spring MVC. ERROR 2 ...

  7. Spring Security Java Config Preview--官方

    原文地址:[1]https://spring.io/blog/2013/07/02/spring-security-java-config-preview-introduction/ [2]https ...

  8. java ldap操作实例_Java Spring Security示例教程中的2种设置LDAP Active Directory身份验证的方法...

    java ldap操作实例 LDAP身份验证是世界上最流行的企业应用程序身份验证机制之一,而Active Directory (Microsoft为Windows提供的LDAP实现)是另一种广泛使用的 ...

  9. 如何使用Java和XML Config在Spring Security中启用HTTP基本身份验证

    在上一篇文章中,我向您展示了如何在Java应用程序中启用Spring安全性 ,今天我们将讨论如何使用Spring Security 在Java Web应用程序中启用Basic HTTP身份验证 . 如 ...

最新文章

  1. html链接伪类设置鼠标悬停,链接伪类可以控制超链接的样式吗?是怎样实现的?...
  2. 论字符界面和WEB界面配置的优缺点
  3. 在Windows平台架设DNS服务器
  4. 判断js对象是否拥有某属性
  5. android 视图覆盖,如何在Android中添加覆盖视图超过其他视图?
  6. 使用Python+tkinter编写电脑桌面放大镜程序
  7. Web Control开发随笔(4):Control与WebControl 的Properity初探
  8. 为什么很多公司不允许使用C++ STL?
  9. BZOJ4407 :于神之怒加强版
  10. linux远程桌面密钥,使用 SSH 密钥连接到 Linux VM - Azure Virtual Machines | Microsoft Docs...
  11. vue axios中文文档详解
  12. 问题及解决方法记录:A component required a bean of type ‘org.springframework.web.client.RestTemplate‘ that cou
  13. 如何快速设计一款智能窗帘开关产品?APP即可控制窗帘动态
  14. javaScript案例——二级联动、三级联动、省市区三级联动
  15. 杭州考驾照-2017.4
  16. 银河麒麟系统中的串口调试
  17. 程序员之天梯排行榜,你在哪一级?
  18. 深度对话 | 关于区块链,关于以太坊,V 神这次又说了啥?
  19. linux 隐藏进程,linux下如何隐藏进程(ps/top)
  20. golang随机数生成——关于rand.Seed的一点记录

热门文章

  1. ssm如何在mapper插入实时的时间_第一个ssm整合
  2. C++ 判断进程是否退出 代码封装
  3. Python爬虫项目--爱拍视频批量下载
  4. ebpf_exporter - Prometheus exporter for custom eBPF metrics
  5. DELL戴尔服务器RAID磁盘阵列默认识别更换后的硬盘
  6. ZooKeeper分布式应用程序的分布式协调服务:概述,入门,发布版本
  7. 终于知道为什么NVIDIA的linux驱动这么烂了,一波官方文档告诉你:Linux GPU Driver Developer’s Guide
  8. linux驱动头文件说明
  9. Python库:Pyinstaller库、pip工具、pip指定安装源和版本
  10. python写tcp通信程序_一个简单的基于TCP通信的服务器端与客户端程序