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
  • 相关阅读:
    Web开发者需具备的8个好习惯
    全球十大搜索引擎排名
    ContextWrapper
    PackageManager
    重写equals方法的注意事项
    StackOverflow 并不只是一个问答网站
    android 中ids.xml资源的使用
    The method dismissDialog(int) from the type Activity is deprecated
    百度员工离职总结:如何做个好员工?
    Mysql 自动化任务
  • 原文地址:https://www.cnblogs.com/Laughing-Lz/p/5091639.html
Copyright © 2011-2022 走看看