Spring Security 中的多个身份验证提供程序 [英] Multiple Authentication Providers in Spring Security

查看:20
本文介绍了Spring Security 中的多个身份验证提供程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Spring Security 配置中配置了两个身份验证提供程序:

I have configured two authentication providers in my Spring Security config:

   <security:authentication-manager>
      <security:authentication-provider ref="XProvider" />
      <security:authentication-provider ref="YProvider" />
   </security:authentication-manager>

spring security 会评估两个提供者吗?或者它会停止评估其中一个是否失败?如果没有,如何让它停止?

Does spring security evaluate both providers? Or does it stop to evaluate if one of them fails? If not, How to make it stop?

谢谢.

推荐答案

您可以指定任意数量的提供程序.它们将按照您在 authentication-manager 标签中声明的顺序进行检查.

You can specify as many providers as you want. They will be checked in the same order you declared them inside the authentication-manager tag.

一旦成功进行身份验证,它将停止轮询提供者.如果任何提供程序抛出 AccountStatusException,它也会中断轮询.

Once a successful authentication is made, it will stop polling the providers. If any provider throws an AccountStatusException it will also break the polling.

这篇关于Spring Security 中的多个身份验证提供程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆