shiro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j_pramanik_ind <jayanta.prama...@gmail.com>
Subject Login failed in Apache SHIRO
Date Wed, 13 Aug 2014 02:27:11 GMT
Hi,

Every time whenever I'm trying to login with token the following Exception
arises.

org.apache.shiro.authc.AuthenticationException: Authentication failed for
token submission [org.apache.shiro.authc.UsernamePasswordToken - 11112222,
rememberMe=false].  Possible unexpected error? (Typical or expected login
exceptions should extend from AuthenticationException).


>From my CustomRealm I'm returning following AuthenticationInfo object with
valid credentials -

            smplAuthInfo = new SimpleAuthenticationInfo(StrLoginid,
StrPassword, StrUname); 
	    smplAuthInfo.setCredentials(StrUname);

CustomRealm is automatically invoked whenever it tries to login with token -

                 org.apache.shiro.subject.Subject currentUser =
SecurityUtils.getSubject();

 		if (!currentUser.isAuthenticated()) { 			
 			UsernamePasswordToken token = new UsernamePasswordToken(username,
password); 			
 			token.setRememberMe(rememberMe);

 			try {
 				*currentUser.login(token);*    
 				System.out.println("User ["	+ currentUser.getPrincipal().toString()	+
"] logged in successfully.");
 				currentUser.getSession().setAttribute("username", username);
 				return true;
 				
 			} catch (UnknownAccountException uae) {
 				System.out.println("There is no user with username of "
 						+ token.getPrincipal());
 			} catch (IncorrectCredentialsException ice) {
 				System.out.println("Password for account "
 						+ token.getPrincipal()
 						+ " was incorrect!");
 			} catch (LockedAccountException lae) {
 				System.out.println("The account for username "
 						+ token.getPrincipal()
 						+ " is locked.  "
 						+ "Please contact your administrator to unlock it.");
 			}

Can anybody please suggest what I'm doing wrong ? Or which configuration I
should look.

Thanks in advance,

Regards,

Jayanta P.







--
View this message in context: http://shiro-developer.582600.n2.nabble.com/Login-failed-in-Apache-SHIRO-tp7578426.html
Sent from the Shiro Developer mailing list archive at Nabble.com.

Mime
View raw message