Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/306.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 与日期相关的shiro登录_Java_Shiro - Fatal编程技术网

Java 与日期相关的shiro登录

Java 与日期相关的shiro登录,java,shiro,Java,Shiro,是否可以使用ApacheShiro创建依赖日期的登录?这意味着我将能够指定特定用户只能在特定日期之间进行应用程序身份验证。如果不满足日期条件,您可以扩展您正在使用的领域并覆盖方法DogeAuthenticationInfo(AuthenticationToken token): public class DateRealm extends JdbcRealm { @Override protected AuthenticationInfo doGetAuthenticationInfo

是否可以使用ApacheShiro创建依赖日期的登录?这意味着我将能够指定特定用户只能在特定日期之间进行应用程序身份验证。

如果不满足日期条件,您可以扩展您正在使用的领域并覆盖方法
DogeAuthenticationInfo(AuthenticationToken token)

public class DateRealm extends JdbcRealm {

  @Override
  protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token)
      throws AuthenticationException {
    Date date = new Date();
    if ( /* Your dat condition here */ true) {
      return super.doGetAuthenticationInfo(token);
    } else {
      return null;
    }
  }
}

如果我依赖IniRealm,有没有可能?好吧,只需将
extensedjdbStream
extensedIniRealm