【问题标题】:SM_USER for every requests from SIteminder (Static requests as well)来自 SIteminder 的每个请求的 SM_USER(以及静态请求)
【发布时间】:2020-05-30 06:29:15
【问题描述】:

Siteminder 将 SM_USER (userId) 发送回应用程序以处理所有请求,包括静态资源请求。除了指定的 Url,我们不需要在每个请求标头中都使用 userId。 谁能帮助如何在 Spring boot+Siteminder 配置中避免这种情况?

下面使用 Siteminder 过滤器,

@覆盖 受保护的无效配置(HttpSecurity http)抛出异常{ http.addFilterBefore(siteminderFilter(), RequestHeaderAuthenticationFilter.class) …… …… }

@豆 公共 RequestHeaderAuthenticationFilter siteminderFilter() 抛出异常 { RequestHeaderAuthenticationFilter 过滤器 = new RequestHeaderAuthenticationFilter(); filter.setPrincipalRequestHeader(smEmpID); filter.setAuthenticationManager(authenticationManagerBean()); filter.setCheckForPrincipalChanges(true); filter.setExceptionIfHeaderMissing(false); 返回过滤器;

谢谢。

【问题讨论】:

  • 我需要避免从所有静态请求头中读取 userId。
  • 您可以忽略静态资源的模式,例如:@Override public void configure(WebSecurity web){web.ignoring().antMatchers("/resources/**", "/static-files/**");}
  • 我们仍然看到同样的问题,谢谢
  • 它造成了什么问题,你是如何发现它的?

标签: spring-boot spring-security siteminder


【解决方案1】:

您可以在 ACO 中设置 DisableUserNameVars=No,它将停止发送 SM_USER

对于您需要用户 ID 的网址,您可以使用用户 ID 设置自定义标头,例如 HTTP_SM_USER。

请注意,根据文档,不建议在应用程序中使用 SM_USER。

对于少数其他应用程序(例如与 SAP 或其他应用程序集成),您必须拥有 SM_USER,因此您无法逃脱。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2010-12-18
    • 2016-06-28
    • 2016-09-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-10-22
    • 2017-12-23
    相关资源
    最近更新 更多