问题标签 [pre-authentication]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
185 浏览

soap - 使用带有 Web 应用程序代理的 SOAP 身份验证的 Organization.svc

我们有一个 CRM Dynamics 2016 内部部署(已配置 IFD),我们通过 SOAP 身份验证从 Cordova 移动应用程序访问 CRM 并使用服务“Organization.svc”来获取或设置数据:到目前为止一切正常。添加 Web 应用程序代理后,对 ADFS 的令牌调用仍然有效,并返回有效令牌。但是,使用服务“Organization.svc”的第二步被阻止:Web 应用程序代理将调用重定向到 ADFS 登录页面,这当然不是我想要的。我认为问题的根源在于代理无法“读取”我在 HTTPRequest 中发送的 SAML 令牌。有谁知道如何解决这个问题?

0 投票
0 回答
227 浏览

magento - 贝宝上的 Magento 订单过期了??如何重新授权magento中的过期订单?

我厌倦了在 magento 中重新授权订单。如何使用 paypal express checkout 在 magento 中重新授权订单。请描述您的答案并解决我的问题。谢谢

0 投票
0 回答
534 浏览

spring - How to implement Spring's pre-authentication header-based in iframe?

I am new in spring secuirty. I have developing two different application app1 and app2. App1 sending a header request (SM_USER) to App2. Which is working fine with pre-authentication process using SSO. But when I have calling this App1 to load App2 url in iframe we get login page in iframe. Our code as follows

App1 code -HTML

App1 code- Controller

And my SSO function details as follows App2 code

App2 code - Controller

Please help ....

0 投票
1 回答
1410 浏览

java - 覆盖现有的 Spring Security 身份验证

如何通过调用 Web 服务来覆盖现有的 Spring Security 身份验证,当它失败时,需要重定向一些第三方登录页面。

要调用此身份验证 Web 服务,我需要获取一些 ServletRequest 参数,而对于重定向,我需要访问 ServletResponse。

因此,我需要找出一些带有 ServletRequest 和 ServletResponse 参数的身份验证方法。

但是,我仍然没有找到这样的 ProcessingFilter 或 AuthenticationProvider。

根据 Spring Security basic,似乎我必须覆盖与 AuthenticationProvider 相关的身份验证方法。

根据用例,我必须实现 Spring Security Pre-authentication,

但问题是 PreAuthenticatedAuthenticationProvider 相关的 'authenticate' 方法只有 Authentication 参数。

PreAuthenticatedAuthenticationProvider

作为解决方案,是否有可能使用AuthenticationFailureHandler的自定义实现?

谢谢。

0 投票
1 回答
1064 浏览

spring - 如何在使用 Spring 的 2 个 Web 应用程序之间使用 PreAuthetication 来避免在第一个应用程序登录后登录第二个应用程序?

我正在尝试PreAuthetication使用 Spring 实现一个系统,但我不明白它是如何工作的。

我有一个应用程序A,用户可以在其中登录。之后,用户可以进入另一个应用程序B。但我不希望用户必须再次登录。

那么我必须把配置放在哪里?在应用程序 A 或 B 内,还是两者兼而有之?

我尝试使用该Siteminder配置,但它不适用于 app 内的配置B。我有这个错误:

org.springframework.security.web.authentication.preauth.PreAuthenticatedCredentialsNotFoundException:在请求中找不到 SM_USER 标头。org.springframework.security.web.authentication.preauth.RequestHeaderAuthenticationFilter.getPreAuthenticatedPrincipal(RequestHeaderAuthenticationFilter.java:48)

0 投票
2 回答
5087 浏览

spring-boot - 匿名访问的 Spring Boot 安全预认证场景

我有一个 Spring Boot (1.5.6) 应用程序,它使用来自 Spring Security 的“预身份验证”身份验证方案 (SiteMinder)。

我需要匿名公开执行器“健康”端点,这意味着对该端点的请求不会通过 SiteMinder,因此 SM_USER 标头不会出现在 HTTP 请求标头中。

我面临的问题是,无论我如何尝试配置“健康”端点,框架都会抛出一个错误,org.springframework.security.web.authentication.preauth.PreAuthenticatedCredentialsNotFoundException因为当请求未通过 SiteMinder 时,预期的标头(“SM_USER”)不存在。

这是我原来的安全配置:

我试图以几种不同的方式排除 /health 端点,但无济于事。

我尝试过的事情:

为匿名访问而不是 permitAll 配置健康端点:

将 WebSecurity 配置为忽略运行状况端点:

关闭所有执行器端点的安全性(不知道,但我正在抓住稻草):

查看日志,问题似乎是 RequestHeaderAuthenticationFilter 被注册为顶级过滤器,而不是现有securityFilterChain中的过滤器:

根据我的理解,因为RequestHeaderAuthenticationFilterextends AbstractPreAuthenticatedProcessingFilter,框架知道在链中插入过滤器的位置,这就是为什么我不修改 addFilter Before或 addFilter After变体的原因。也许我应该是?有人知道明确插入过滤器的正确位置吗?(我认为在 Spring Security 的早期版本中删除了显式指定过滤器顺序的需要)

我知道我可以配置它,RequestHeaderAuthenticationFilter这样如果标题不存在,它就不会抛出异常,但如果可能的话,我想保持这种状态。

我发现这个 SO 帖子似乎与我的问题相似,但不幸的是那里也没有答案。 spring-boot-security-preauthentication-with-permitted-resources-still-authenti

任何帮助将不胜感激!谢谢!

0 投票
1 回答
800 浏览

spring - 如何为 Spring Webflux 应用程序实现自定义 Spring Security PreAuthentication 场景?

为了使用 Webflux 对基于 Spring MVC 的应用程序进行现代化改造,我需要更新我的自定义 PreAuthentication 场景。我已经使用FilterBeans 构建了一个很好的解决方案(如https://docs.spring.io/spring-security/site/docs/current/reference/htmlsingle/#preauth中所述)。

但是,我找不到将此解决方案迁移到反应性场景的良好起点。谁能帮我指出正确的方向?

0 投票
1 回答
95 浏览

spring-boot - 具有使用 CSRF 保护的预认证过滤器的 Spring Boot 微服务

我在我的微服务中使用 SSO 和 preAuthenticated Filter。微服务是使用 Spring Boot 构建的,本质上是无状态的。如何使用 Spring Security 在所有微服务中应用 CSRF 保护。请让我知道是否有任何解决方案可用于为此场景实施 CSRF。

0 投票
0 回答
2192 浏览

spring-security - PreAuthenticatedAuthenticationProvider UserDetailsS​​ervice 如何捕获正确的异常

我在 Spring Boot 2.0.5(Spring Security 5.0.8)下

我已经设置了一个预身份验证过滤器链,它工作正常,唯一有问题的是异常处理,尤其是那些从我的自定义 UserDetailsS​​ervice 中抛出的异常处理。我也尝试用“enabled = false”返回一个用户,但还是一样。

请参阅下面的代码了解我的自定义 UserDetailsS​​ervice:

还有我的安全配置:

我也尝试使用“accessDeniedHandler”,但它从未通过它。

问题是,对于抛出的任何异常(在我的自定义 UserDetailsS​​ervice 或其他人中),它都会通过我的自定义“AuthenticationEntryPoint”并始终出现类似的异常,见下文:

任何想法都会很棒!

0 投票
1 回答
142 浏览

java - Springboot @PreAuthorize 与 @EnableTransactionManagement 冲突

我知道这听起来有点奇怪,但是我们遇到了一个问题,当我们添加@EnableTransactionManagement应用程序时,所有控制器@PreAuthorize都无法访问,swagger 无法发现它并且调用 API(具有正确的权限和角色)会遇到 404 not found错误。

要解决这个问题,要么删除@EnableTransactionManagement应用程序配置中的,要么删除@PreAuthorize控制器中的 ,但无论哪种方式都不是最终解决方案。

所以我想问一下是否有专家知道造成这种情况的原因以及我们需要做什么才能使事情正常进行,因为我们都需要在应用程序中进行交易和预授权。