org.springframework.security.authentication.AbstractAuthenticationToken.equals()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(7.1k)|赞(0)|评价(0)|浏览(119)

本文整理了Java中org.springframework.security.authentication.AbstractAuthenticationToken.equals()方法的一些代码示例,展示了AbstractAuthenticationToken.equals()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AbstractAuthenticationToken.equals()方法的具体详情如下:
包路径:org.springframework.security.authentication.AbstractAuthenticationToken
类名称:AbstractAuthenticationToken
方法名:equals

AbstractAuthenticationToken.equals介绍

暂无

代码示例

代码示例来源:origin: spring-projects/spring-security

@Override
public boolean equals(Object obj) {
  if (!super.equals(obj)) {
    return false;
  }
  if (obj instanceof AnonymousAuthenticationToken) {
    AnonymousAuthenticationToken test = (AnonymousAuthenticationToken) obj;
    if (this.getKeyHash() != test.getKeyHash()) {
      return false;
    }
    return true;
  }
  return false;
}

代码示例来源:origin: spring-projects/spring-security

@Override
public boolean equals(Object obj) {
  if (!super.equals(obj)) {
    return false;
  }
  if (obj instanceof RememberMeAuthenticationToken) {
    RememberMeAuthenticationToken test = (RememberMeAuthenticationToken) obj;
    if (this.getKeyHash() != test.getKeyHash()) {
      return false;
    }
    return true;
  }
  return false;
}

代码示例来源:origin: org.springframework.security/spring-security-core

@Override
public boolean equals(Object obj) {
  if (!super.equals(obj)) {
    return false;
  }
  if (obj instanceof AnonymousAuthenticationToken) {
    AnonymousAuthenticationToken test = (AnonymousAuthenticationToken) obj;
    if (this.getKeyHash() != test.getKeyHash()) {
      return false;
    }
    return true;
  }
  return false;
}

代码示例来源:origin: org.springframework.security/spring-security-core

@Override
public boolean equals(Object obj) {
  if (!super.equals(obj)) {
    return false;
  }
  if (obj instanceof RememberMeAuthenticationToken) {
    RememberMeAuthenticationToken test = (RememberMeAuthenticationToken) obj;
    if (this.getKeyHash() != test.getKeyHash()) {
      return false;
    }
    return true;
  }
  return false;
}

代码示例来源:origin: spring-projects/spring-security

@Override
public boolean equals(final Object obj) {
  if (!super.equals(obj)) {
    return false;
  }
  if (obj instanceof CasAuthenticationToken) {
    CasAuthenticationToken test = (CasAuthenticationToken) obj;
    if (!this.assertion.equals(test.getAssertion())) {
      return false;
    }
    if (this.getKeyHash() != test.getKeyHash()) {
      return false;
    }
    return true;
  }
  return false;
}

代码示例来源:origin: spring-projects/spring-security-oauth

@Override
public boolean equals(Object o) {
  if (this == o) {
    return true;
  }
  if (!(o instanceof OAuth2Authentication)) {
    return false;
  }
  if (!super.equals(o)) {
    return false;
  }
  OAuth2Authentication that = (OAuth2Authentication) o;
  if (!storedRequest.equals(that.storedRequest)) {
    return false;
  }
  if (userAuthentication != null ? !userAuthentication.equals(that.userAuthentication)
      : that.userAuthentication != null) {
    return false;
  }
  
  if (getDetails()!=null ? !getDetails().equals(that.getDetails()) : that.getDetails()!=null) {
    // return false;
  }
  return true;
}

代码示例来源:origin: org.springframework.security.kerberos/spring-security-kerberos-core

/**
 * equals() is based only on the Kerberos token
 */
@Override
public boolean equals(Object obj) {
  if (this == obj)
    return true;
  if (!super.equals(obj))
    return false;
  if (getClass() != obj.getClass())
    return false;
  KerberosServiceRequestToken other = (KerberosServiceRequestToken) obj;
  if (!Arrays.equals(token, other.token))
    return false;
  return true;
}

代码示例来源:origin: org.apache.cxf.fediz/fediz-idp-core

/**
 * equals() is based only on the Kerberos token
 */
@Override
public boolean equals(Object obj) {
  if (this == obj) {
    return true;
  }
  if (!super.equals(obj)) {
    return false;
  }
  if (getClass() != obj.getClass()) {
    return false;
  }
  KerberosServiceRequestToken other = (KerberosServiceRequestToken) obj;
  if (!Arrays.equals(token, other.token)) {       //NOPMD
    return false;
  }
  return true;
}

代码示例来源:origin: 1and1/cosmo

/**
 * Equals.
 * {@inheritDoc}
 * @param obj The obj.
 * @return The result.
 */
@Override
public boolean equals(Object obj) {
  if (! super.equals(obj)) {
    return false;
  }
  if (! (obj instanceof TicketAuthenticationToken)) {
    return false;
  }
  TicketAuthenticationToken test = (TicketAuthenticationToken) obj;
  //After authentication, the token's principal is the {@link Ticket} itself.
  return ticket.equals(test.getPrincipal());
}

代码示例来源:origin: net.oneandone.cosmo/cosmo-core

/**
 * Equals.
 * {@inheritDoc}
 * @param obj The obj.
 * @return The result.
 */
@Override
public boolean equals(Object obj) {
  if (! super.equals(obj)) {
    return false;
  }
  if (! (obj instanceof TicketAuthenticationToken)) {
    return false;
  }
  TicketAuthenticationToken test = (TicketAuthenticationToken) obj;
  //After authentication, the token's principal is the {@link Ticket} itself.
  return ticket.equals(test.getPrincipal());
}

代码示例来源:origin: OneBusAway/onebusaway-application-modules

public boolean equals(Object obj) {
 if (!super.equals(obj))
  return false;
 if (obj instanceof EveryLastLoginAuthenticationToken) {
  EveryLastLoginAuthenticationToken test = (EveryLastLoginAuthenticationToken) obj;
  return this.getKeyHash() == test.getKeyHash();
 }
 return false;
}

代码示例来源:origin: org.springframework.security/org.springframework.security.core

public boolean equals(Object obj) {
  if (!super.equals(obj)) {
    return false;
  }
  if (obj instanceof AnonymousAuthenticationToken) {
    AnonymousAuthenticationToken test = (AnonymousAuthenticationToken) obj;
    if (this.getKeyHash() != test.getKeyHash()) {
      return false;
    }
    return true;
  }
  return false;
}

代码示例来源:origin: org.springframework.security/org.springframework.security.core

public boolean equals(Object obj) {
  if (!super.equals(obj)) {
    return false;
  }
  if (obj instanceof RememberMeAuthenticationToken) {
    RememberMeAuthenticationToken test = (RememberMeAuthenticationToken) obj;
    if (this.getKeyHash() != test.getKeyHash()) {
      return false;
    }
    return true;
  }
  return false;
}

代码示例来源:origin: apache/servicemix-bundles

@Override
public boolean equals(Object obj) {
  if (!super.equals(obj)) {
    return false;
  }
  if (obj instanceof AnonymousAuthenticationToken) {
    AnonymousAuthenticationToken test = (AnonymousAuthenticationToken) obj;
    if (this.getKeyHash() != test.getKeyHash()) {
      return false;
    }
    return true;
  }
  return false;
}

代码示例来源:origin: apache/servicemix-bundles

@Override
public boolean equals(Object obj) {
  if (!super.equals(obj)) {
    return false;
  }
  if (obj instanceof RememberMeAuthenticationToken) {
    RememberMeAuthenticationToken test = (RememberMeAuthenticationToken) obj;
    if (this.getKeyHash() != test.getKeyHash()) {
      return false;
    }
    return true;
  }
  return false;
}

代码示例来源:origin: apache/servicemix-bundles

@Override
public boolean equals(final Object obj) {
  if (!super.equals(obj)) {
    return false;
  }
  if (obj instanceof CasAuthenticationToken) {
    CasAuthenticationToken test = (CasAuthenticationToken) obj;
    if (!this.assertion.equals(test.getAssertion())) {
      return false;
    }
    if (this.getKeyHash() != test.getKeyHash()) {
      return false;
    }
    return true;
  }
  return false;
}

代码示例来源:origin: org.springframework.security/spring-security-cas

@Override
public boolean equals(final Object obj) {
  if (!super.equals(obj)) {
    return false;
  }
  if (obj instanceof CasAuthenticationToken) {
    CasAuthenticationToken test = (CasAuthenticationToken) obj;
    if (!this.assertion.equals(test.getAssertion())) {
      return false;
    }
    if (this.getKeyHash() != test.getKeyHash()) {
      return false;
    }
    return true;
  }
  return false;
}

代码示例来源:origin: org.springframework.security.oauth/spring-security-oauth2

@Override
public boolean equals(Object o) {
  if (this == o) {
    return true;
  }
  if (!(o instanceof OAuth2Authentication)) {
    return false;
  }
  if (!super.equals(o)) {
    return false;
  }
  OAuth2Authentication that = (OAuth2Authentication) o;
  if (!storedRequest.equals(that.storedRequest)) {
    return false;
  }
  if (userAuthentication != null ? !userAuthentication.equals(that.userAuthentication)
      : that.userAuthentication != null) {
    return false;
  }
  
  if (getDetails()!=null ? !getDetails().equals(that.getDetails()) : that.getDetails()!=null) {
    // return false;
  }
  return true;
}

相关文章