类 AnySuccessfulStrategy

  • 所有已实现的接口:
    org.apache.shiro.authc.pam.AuthenticationStrategy

    @IocBean(name="authenticationStrategy")
    public class AnySuccessfulStrategy
    extends org.apache.shiro.authc.pam.AbstractAuthenticationStrategy
    • 方法概要

      所有方法 实例方法 具体方法 
      修饰符和类型 方法 说明
      org.apache.shiro.authc.AuthenticationInfo afterAttempt​(org.apache.shiro.realm.Realm realm, org.apache.shiro.authc.AuthenticationToken token, org.apache.shiro.authc.AuthenticationInfo singleRealmInfo, org.apache.shiro.authc.AuthenticationInfo aggregateInfo, Throwable t)  
      org.apache.shiro.authc.AuthenticationInfo beforeAllAttempts​(Collection<? extends org.apache.shiro.realm.Realm> realms, org.apache.shiro.authc.AuthenticationToken token)
      Returns null immediately, relying on this class's merge implementation to return only the first info object it encounters, ignoring all subsequent ones.
      protected org.apache.shiro.authc.AuthenticationInfo merge​(org.apache.shiro.authc.AuthenticationInfo info, org.apache.shiro.authc.AuthenticationInfo aggregate)
      Returns the specified aggregate instance if is non null and valid (that is, has principals and they are not empty) immediately, or, if it is null or not valid, the info argument is returned instead.
      • 从类继承的方法 org.apache.shiro.authc.pam.AbstractAuthenticationStrategy

        afterAllAttempts, beforeAttempt
    • 构造器详细资料

      • AnySuccessfulStrategy

        public AnySuccessfulStrategy()
    • 方法详细资料

      • beforeAllAttempts

        public org.apache.shiro.authc.AuthenticationInfo beforeAllAttempts​(Collection<? extends org.apache.shiro.realm.Realm> realms,
                                                                           org.apache.shiro.authc.AuthenticationToken token)
                                                                    throws org.apache.shiro.authc.AuthenticationException
        Returns null immediately, relying on this class's merge implementation to return only the first info object it encounters, ignoring all subsequent ones.
        指定者:
        beforeAllAttempts 在接口中 org.apache.shiro.authc.pam.AuthenticationStrategy
        覆盖:
        beforeAllAttempts 在类中 org.apache.shiro.authc.pam.AbstractAuthenticationStrategy
        抛出:
        org.apache.shiro.authc.AuthenticationException
      • merge

        protected org.apache.shiro.authc.AuthenticationInfo merge​(org.apache.shiro.authc.AuthenticationInfo info,
                                                                  org.apache.shiro.authc.AuthenticationInfo aggregate)
        Returns the specified aggregate instance if is non null and valid (that is, has principals and they are not empty) immediately, or, if it is null or not valid, the info argument is returned instead.

        This logic ensures that the first valid info encountered is the one retained and all subsequent ones are ignored, since this strategy mandates that only the info from the first successfully authenticated realm be used.

        覆盖:
        merge 在类中 org.apache.shiro.authc.pam.AbstractAuthenticationStrategy
      • afterAttempt

        public org.apache.shiro.authc.AuthenticationInfo afterAttempt​(org.apache.shiro.realm.Realm realm,
                                                                      org.apache.shiro.authc.AuthenticationToken token,
                                                                      org.apache.shiro.authc.AuthenticationInfo singleRealmInfo,
                                                                      org.apache.shiro.authc.AuthenticationInfo aggregateInfo,
                                                                      Throwable t)
                                                               throws org.apache.shiro.authc.AuthenticationException
        指定者:
        afterAttempt 在接口中 org.apache.shiro.authc.pam.AuthenticationStrategy
        覆盖:
        afterAttempt 在类中 org.apache.shiro.authc.pam.AbstractAuthenticationStrategy
        抛出:
        org.apache.shiro.authc.AuthenticationException