SecurityConfig.java
:
Код: Выделить всё
package com.leo.service-ui.configs.security;
import java.util.Collections;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.FileSystemResource;
import org.springframework.core.io.Resource;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.authentication.ProviderManager;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.builders.WebSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityCustomizer;
import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer;
import org.springframework.security.web.SecurityFilterChain;
import org.springframework.security.web.authentication.ExceptionMappingAuthenticationFailureHandler;
import org.springframework.security.web.authentication.www.BasicAuthenticationFilter;
@EnableWebSecurity
@Configuration
public class SecurityConfig {
private static final Logger LOG = LogManager.getLogger(SecurityConfig.class);
@Bean
public CustomSpnegoEntryPoint customSpnegoEntryPoint() {
return new CustomSpnegoEntryPoint();
}
@Bean
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
LOG.info("SSO is disabled. Continuing using LDAP Authentication.");
http.csrf(AbstractHttpConfigurer::disable).authorizeHttpRequests((authz) -> authz.requestMatchers("/login")
.permitAll()
.anyRequest()
.permitAll());
return http.build();
}
@Bean
public WebSecurityCustomizer webSecurityCustomizer() {
return (web) -> web.ignoring()
.requestMatchers(
"/images/**",
"/js/**",
"/css/**",
"/webjars/**",
"/resources/**",
"/jakarta.faces.resource/**",
"/jakarta.faces.resource/images/**");
}
}
Код: Выделить всё
LEO TEST UI
jQuery.noConflict()
//
var url = window.location.pathname;
var filename = url.substring(url.lastIndexOf('/') + 1);
if (filename.indexOf("login.xhtml") == -1) {
window.location = "/service-ui/login.xhtml"
}
jQuery(document).ready(function() {
});
//
LEO Markets
SERVICE UI[/b]
*
*
*
Use your Windows username/password to login.
If you have not been explicitly granted access, you can still login but with restricted access.
Дополнительная информация:
- Версия Spring Boot: 6< /li>
Версия Java: 17 - Версия PrimeFaces: 14
Подробнее здесь: https://stackoverflow.com/questions/791 ... login-page
Мобильная версия