mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-06-28 14:52:24 +00:00
SEC-2919: Polish
Remove now unnecessary AuthenticationConfig.Builder#getLoginFormUrl method.
This commit is contained in:
parent
052bd32f40
commit
ec89fdcfaa
@ -560,7 +560,7 @@ final class AuthenticationConfigBuilder {
|
|||||||
void createLogoutFilter() {
|
void createLogoutFilter() {
|
||||||
Element logoutElt = DomUtils.getChildElementByTagName(httpElt, Elements.LOGOUT);
|
Element logoutElt = DomUtils.getChildElementByTagName(httpElt, Elements.LOGOUT);
|
||||||
if (logoutElt != null || autoConfig) {
|
if (logoutElt != null || autoConfig) {
|
||||||
String formLoginPage = getLoginFormUrl(formEntryPoint);
|
String formLoginPage = this.formLoginPage;
|
||||||
if (formLoginPage == null) {
|
if (formLoginPage == null) {
|
||||||
formLoginPage = DefaultLoginPageGeneratingFilter.DEFAULT_LOGIN_PAGE_URL;
|
formLoginPage = DefaultLoginPageGeneratingFilter.DEFAULT_LOGIN_PAGE_URL;
|
||||||
}
|
}
|
||||||
@ -720,8 +720,6 @@ final class AuthenticationConfigBuilder {
|
|||||||
// If formLogin has been enabled either through an element or auto-config, then it
|
// If formLogin has been enabled either through an element or auto-config, then it
|
||||||
// is used if no openID login page
|
// is used if no openID login page
|
||||||
// has been set.
|
// has been set.
|
||||||
String formLoginPage = getLoginFormUrl(formEntryPoint);
|
|
||||||
String openIDLoginPage = getLoginFormUrl(openIDEntryPoint);
|
|
||||||
|
|
||||||
if (formLoginPage != null && openIDLoginPage != null) {
|
if (formLoginPage != null && openIDLoginPage != null) {
|
||||||
pc.getReaderContext().error(
|
pc.getReaderContext().error(
|
||||||
@ -751,26 +749,6 @@ final class AuthenticationConfigBuilder {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getLoginFormUrl(BeanDefinition entryPoint) {
|
|
||||||
if (entryPoint == null) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
ConstructorArgumentValues cavs = entryPoint.getConstructorArgumentValues();
|
|
||||||
ValueHolder vh = cavs.getIndexedArgumentValue(0, String.class);
|
|
||||||
if (vh == null) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// If the login URL is the default one, then it is assumed not to have been set
|
|
||||||
// explicitly
|
|
||||||
if (DefaultLoginPageGeneratingFilter.DEFAULT_LOGIN_PAGE_URL.equals(vh.getValue())) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (String) vh.getValue();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void createUserDetailsServiceFactory() {
|
private void createUserDetailsServiceFactory() {
|
||||||
if (pc.getRegistry().containsBeanDefinition(BeanIds.USER_DETAILS_SERVICE_FACTORY)) {
|
if (pc.getRegistry().containsBeanDefinition(BeanIds.USER_DETAILS_SERVICE_FACTORY)) {
|
||||||
// Multiple <http> case
|
// Multiple <http> case
|
||||||
|
Loading…
x
Reference in New Issue
Block a user