- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个 Spring Boot 应用程序,它应该允许针对数据库的基于表单的身份验证和基于 SSO CAS 的身份验证。
我遵循了这里的示例( https://www.baeldung.com/spring-security-multiple-entry-points ),在我看来 Order 没有按预期工作。它总是使用注释为 Order(1) 的那个作为入口点。
这是我的代码,
@Configuration
@EnableWebSecurity
public class SecurityConfig {
@Configuration
@Order(2)
public static class WebSecurityCASConfig extends WebSecurityConfigurerAdapter {
public WebSecurityCASConfig() {
super();
}
@Autowired
private AuthenticationEntryPoint authenticationEntryPoint;
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.authorizeRequests()
.antMatchers(
"/js/**",
"/css/**",
"/images/**").permitAll()
.regexMatchers("/login1")
.authenticated()
.and()
.authorizeRequests()
.and()
.httpBasic()
.authenticationEntryPoint(authenticationEntryPoint);
}
}
//second
@Configuration
@Order(1)
public static class WebSecurityDatabaseConfig extends WebSecurityConfigurerAdapter {
public WebSecurityDatabaseConfig() {
super();
}
@Autowired
UserDetailServiceImpl userDetailsService;
@Autowired
BCryptPasswordEncoder passwordEncoder;
@Autowired
public void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.userDetailsService(userDetailsService)
.passwordEncoder(passwordEncoder);
}
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.authorizeRequests()
.antMatchers(
"/js/**",
"/css/**",
"/images/**").permitAll()
//.antMatchers("/catalog").access("hasAnyRole('ROLE_USER', 'ROLE_ADMIN')")
////.antMatchers("/login1").permitAll()
.anyRequest().authenticated()
.and()
.formLogin()
.loginPage("/login")
.defaultSuccessUrl("/catalog", true)
.permitAll()
.usernameParameter("username")
.passwordParameter("password")
.and()
.logout()
.permitAll()
.logoutUrl("/logout").logoutSuccessUrl("/logout")
.and().exceptionHandling().accessDeniedPage("/403");
}
}
}
最佳答案
我为此找到了解决方案。我只是简单地遵循 spring 文档在 5.9 ( https://docs.spring.io/spring-security/site/docs/5.0.0.RELEASE/reference/htmlsingle/ ) 中所说的以及关于 stackoverflow 的另一个问题,Spring Security : Multiple HTTP Config not working
关于spring - Spring Security 中的多个入口点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54541546/
通常入口重写目标的工作原理如下: nginx.ingress.kubernetes.io/rewrite-target: / 这将重写服务名称的目标,因为它们在根目录中。所以如果我有这个: apiVe
我正在使用 Helm 部署的 GKE (1.8.5-gke.0) 上运行 traefik 入口 Controller 。我观察到的是请求经常得到 404 响应。 看起来 traefik 会不断重新加载
是否可以在没有负载均衡器的情况下在 Kubernetes 中使用 Ingress Controller 功能(在 Digital Ocean 中)。 有没有其他机制可以让域名映射到Kubernetes
我使用 KOPS 和 nginx-ingress 在 AWS 上部署了 Kubernetes。 为了评估多个云(并削减成本),我想在 GKE 上进行部署。一切正常,除了该死的 Ingress。 (这是
要求:想要使用带有 HTTPS 的入口部署 Minio 和另一个后端服务(不用于生产目的) 我一直在尝试创建一个入口以从 GKE 中的 Kubernetes 集群外部访问两个服务。这些是我尝试过的尝试
我对使用漏斗可视化功能的谷歌分析有点坚持。 输入漏斗可视化时,它会显示带有数字的“(入口)”。 这代表什么? 最佳答案 这表示在漏斗中第一步所代表的特定页面或一组页面上进入您网站的人数。 关于goog
我尝试在我的 kubernetes 集群上配置入口。我关注了documentation安装入口 Controller 并运行以下命令 kubectl apply -f https://raw.gith
我无法连接到使用 nginx 入口运行的应用程序(Docker Desktop win 10)。 nginx-ingress Controller pod 正在运行,应用程序运行良好,并且我创建了一个
我试图弄清楚如何使用具有某些特定规则的 nginx 代理缓存。例如,当我托管 Ghost 或 Wordpress 时,我不想缓存管理部分。使用服务器片段,我尝试了很多不同的组合,但在管理部分的缓存仍然
我正在尝试将AKS入口的IP列入白名单。我目前正在使用未随Helm一起安装的ingress-nginx。 强制性kubernetes资源可以在here中找到 服务启动为: spec: extern
我的机构有防火墙设置,阻止了大部分外部端口,目前,我有内部 Linux 虚拟机,例如, http://abc.xyz:5555 (此链接只能在内网访问),并且管理员设置了Netscaler,以便将内部
我正在尝试根据用户代理代理_传递流量。试图为它使用服务器代码段/配置代码段,但入口不允许我。 (禁止在 server-snippet 中使用 proxy_pass 并在 configuration-s
我已经使用 nginx-stable 安装了 nginx helm 图表和配置的入口规则如下。虽然它仅适用于根路径,如下所示, /user/login - working /user/register
使用 KOPS 在 AWS 上部署 k8s。 我已经创建了 nginx 入口 https://github.com/kubernetes/ingress-nginx nginx-ingress-con
在我的聊天应用程序中,当一个用户将另一个人添加到他/她的联系人列表中时,服务器条目显示 BOTH 订阅,但在我的应用程序中,代码根据 TO/FROM 订阅工作(就像在接受 friend 请求之前一样)
我在 Python 中有一个实用程序模块,它需要知道正在使用它的应用程序的名称。实际上,这意味着被调用以启动应用程序的顶级 python 脚本的名称(即,其中__name=="__main__"为真)
在这种情况下,我将如何实现“OnButtonClick”以便在按下按钮时打印用户输入“e1”? from Tkinter import * class App: def __init__
我使用以下命令在本地生成 key 。 openssl genrsa -out testsvc.testns.ing.lb.xyz.io.key.pem 2048 并使用以下命令生成 CSR(证书签名请
我正在运行 mint 17.2 kde。 我通过在 ~/Downloads/中运行 idea.sh 安装了 intellij CE 然后我将 intellij 移动到/usr/lib/。现在,当我尝试
我无法让 Controller 工作。尝试了很多次,我仍然得到 Error: ImagePullBackOff。 有没有我可以尝试的替代方案或者它失败的原因? kubectl apply -f
我是一名优秀的程序员,十分优秀!