Java 如何在没有配置的情况下使用spring boot security进行自定义登录页面?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/43651814/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-12 01:05:23  来源:igfitidea点击:

How to use spring boot security for custom login page without configuration?

javasessionspring-bootspring-security

提问by Kabindra Shrestha

I am using spring security on spring boot app and I cannot use the custom login page I made. I want to use custom login page by default without using configuration controller, instead I want to change configuration from application.properties. Also I want to deny access to other pages until login successful. Please help me to log out of the application.

我在 spring boot 应用程序上使用 spring security,我无法使用我制作的自定义登录页面。我想默认使用自定义登录页面而不使用配置控制器,而是我想从 application.properties 更改配置。另外我想拒绝访问其他页面,直到登录成功。请帮助我退出应用程序。

采纳答案by P?r Nilsson

The Spring Security Reference provides an extensive guideon how to implement your custom login page.

Spring Security Reference 提供了有关如何实现自定义登录页面的广泛指南

I put together a small example in this repo

我在这个 repo 中整理了一个小例子

回答by Taher Mahodia

Spring Security With Customn login Page

带有自定义登录页面的 Spring Security

An example of spring security with custom login page is provided along with that sitemash+hibernate is also implemented you have to create a database dumb is given in the readme file.

提供了一个带有自定义登录页面的 spring 安全示例,同时还实现了 sitemash+hibernate,您必须在自述文件中创建一个哑数据库。