Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

25 linhas
943 B

  1. package com.iformall.shiro;
  2. import com.iformall.enums.EnumLoginType;
  3. import org.apache.shiro.authc.AuthenticationInfo;
  4. import org.apache.shiro.authc.AuthenticationToken;
  5. import org.apache.shiro.authc.credential.HashedCredentialsMatcher;
  6. import org.springframework.context.annotation.Configuration;
  7. @Configuration
  8. public class MyRetryLimitCredentialsMatcher extends HashedCredentialsMatcher {
  9. @Override
  10. public boolean doCredentialsMatch(AuthenticationToken authcToken, AuthenticationInfo info) {
  11. if(authcToken instanceof UseriFormallToken) {
  12. UseriFormallToken tk = (UseriFormallToken) authcToken;
  13. if(tk.getType().equals(EnumLoginType.NOPASSWD)){
  14. return true;
  15. }
  16. boolean matches = super.doCredentialsMatch(authcToken, info);
  17. return matches;
  18. }
  19. boolean matches =super.doCredentialsMatch(authcToken, info);
  20. return matches;
  21. }
  22. }