zoukankan      html  css  js  c++  java
  • shiro 权限框架,登陆报以下错误Authentication failed for token submission

    Authentication failed for token submission [org.apache.shiro.authc.UsernamePasswordToken - admin, rememberMe=false].  
    Possible unexpected error? (Typical or expected login exceptions should extend from AuthenticationException).
    原因:
    我今天也遇到了这个错误,并不是密码验证错误, 我用的mabatis 有个mapperxml配置文件写错(并非登录相关的mapper),
    参数类型是parametertype 我搞成了parametermap 报错就是这个错误。分析下在登录时login方法会调用我们重写的doGetAuthenticationInfo方法,
    这个方法我们会通过dao实现层写的登录验证相关方法(我的是Admin admin = this.accountService.findAdmin(username))来将登录信息存入
    SimpleAuthenticationInfo,就是在这个地方,项目会加载我们所配置的相关信息,对我而言就是mabatis里的xml 因为xml里的配置有错,
    所以Admin admin = this.accountService.findAdmin(username)这个方法尽管与出错的xml无关也会报错。
    所以说应该检查下自己与doGetAuthenticationInfo相关的配置文件是否有从,可以try{currentUser.login(token)}
    catch(AuthenticationException a){}异常捕获后再次debug调试,就能发现问题出在哪里了。
    —————————————————————————————————————行走在人猿的并行线——Laughing_Lz
  • 相关阅读:
    使用Xtrabackup 备份mysql数据库
    Myeclipse总结
    intellij idea问题及技巧
    Tomcat相关配置
    Spark常用算子总结
    前端开发经验
    最近用到的SQL语句
    subline text使用心得
    天龙八部谁是主角?(MR词频统计)
    elasticsearch CURL命令
  • 原文地址:https://www.cnblogs.com/Laughing-Lz/p/5091639.html
Copyright © 2011-2022 走看看