NutzCN Logo
问答 shiro **Realm的doGetAuthenticationInfo
发布于 2450天前 作者 qq_32ee9e89 1973 次浏览 复制 上一个帖子 下一个帖子
标签:

shiro **Realm的doGetAuthenticationInfo方法执行到下边
UsernamePasswordToken tokens = (UsernamePasswordToken) token;
报如下错误。
nutz-integration-shiro版本 1.r.62
shiro-all 版本 1.3.0

org.apache.shiro.authc.AuthenticationException: Authentication failed for token submission [org.nutz.integration.shiro.SimpleShiroToken@18b37713].  Possible unexpected error? (Typical or expected login exceptions should extend from AuthenticationException).
	at org.apache.shiro.authc.AbstractAuthenticator.authenticate(AbstractAuthenticator.java:214)
	at org.apache.shiro.mgt.AuthenticatingSecurityManager.authenticate(AuthenticatingSecurityManager.java:106)
	at org.apache.shiro.mgt.DefaultSecurityManager.login(DefaultSecurityManager.java:270)
	at org.apache.shiro.subject.support.DelegatingSubject.login(DelegatingSubject.java:256)
	at demo.LoginController.login(LoginController.java:41)
	at demo.LoginController$FM$login$db69e29afa4fe06cf697426d890dcd5d.invoke(LoginController.java)
	at org.nutz.mvc.impl.processor.MethodInvokeProcessor.process(MethodInvokeProcessor.java:31)
10 回复

你之前的帖子都没有结.

token的类型是 SimpleShiroToken , 不是 UsernamePasswordToken

我想直接获取前台传过来的用户名和密码。因为是做三方校验。

在入口方法做

SimpleAuthenticationInfo info = new SimpleAuthenticationInfo("123", "345" .toCharArray(),getName());
那我SimpleAuthenticationInfo方法传什么参数返回,不传参数好像登录不上去吧

看我贴的链接

assertCredentialsMatch方法是关键

对shiro了解不够透彻,我学习学习再来继续解决这个问题

里面有demo嘛

添加回复
请先登陆
回到顶部