Throwable t = null; try { info = realm.getAuthenticationInfo(token); } catch (Throwable throwable) { t = throwable;
/** * Performs the authentication attempt by interacting with the single configured realm, which is significantly * simpler than performing multi-realm logic. * * @param realm the realm to consult for AuthenticationInfo. * @param token the submitted AuthenticationToken representing the subject's (user's) log-in principals and credentials. * @return the AuthenticationInfo associated with the user account corresponding to the specified {@code token} */ protected AuthenticationInfo doSingleRealmAuthentication(Realm realm, AuthenticationToken token) { if (!realm.supports(token)) { String msg = "Realm [" + realm + "] does not support authentication token [" + token + "]. Please ensure that the appropriate Realm implementation is " + "configured correctly or that the realm accepts AuthenticationTokens of this type."; throw new UnsupportedTokenException(msg); } AuthenticationInfo info = realm.getAuthenticationInfo(token); if (info == null) { String msg = "Realm [" + realm + "] was unable to find account data for the " + "submitted AuthenticationToken [" + token + "]."; throw new UnknownAccountException(msg); } return info; }
Throwable t = null; try { info = realm.getAuthenticationInfo(token); } catch (Throwable throwable) { t = throwable;
/** * Performs the authentication attempt by interacting with the single configured realm, which is significantly * simpler than performing multi-realm logic. * * @param realm the realm to consult for AuthenticationInfo. * @param token the submitted AuthenticationToken representing the subject's (user's) log-in principals and credentials. * @return the AuthenticationInfo associated with the user account corresponding to the specified {@code token} */ protected AuthenticationInfo doSingleRealmAuthentication(Realm realm, AuthenticationToken token) { if (!realm.supports(token)) { String msg = "Realm [" + realm + "] does not support authentication token [" + token + "]. Please ensure that the appropriate Realm implementation is " + "configured correctly or that the realm accepts AuthenticationTokens of this type."; throw new UnsupportedTokenException(msg); } AuthenticationInfo info = realm.getAuthenticationInfo(token); if (info == null) { String msg = "Realm [" + realm + "] was unable to find account data for the " + "submitted AuthenticationToken [" + token + "]."; throw new UnknownAccountException(msg); } return info; }
return realm.getAuthenticationInfo(token); } catch (Throwable throwable) { if (log.isDebugEnabled()) {
AuthenticationInfo info = realm.getAuthenticationInfo(token); if (info != null) { return info;
return realm.getAuthenticationInfo(token); } catch (Throwable throwable) { if (log.isDebugEnabled()) {
AuthenticationInfo info = realm.getAuthenticationInfo( token );
Throwable t = null; try { info = realm.getAuthenticationInfo(token); } catch (Throwable throwable) { t = throwable;
Throwable t = null; try { info = realm.getAuthenticationInfo(token); loginSucceeded = true; } catch (Exception exception) {
info = realm.getAuthenticationInfo(token); } catch (Throwable throwable) { t = throwable;
Throwable t = null; try { info = realm.getAuthenticationInfo(token); loginSucceeded = true; } catch (Exception exception) {
/** * Performs the authentication attempt by interacting with the single configured realm, which is significantly * simpler than performing multi-realm logic. * * @param realm the realm to consult for AuthenticationInfo. * @param token the submitted AuthenticationToken representing the subject's (user's) log-in principals and credentials. * @return the AuthenticationInfo associated with the user account corresponding to the specified {@code token} */ protected AuthenticationInfo doSingleRealmAuthentication(Realm realm, AuthenticationToken token) { if (!realm.supports(token)) { String msg = "Realm [" + realm + "] does not support authentication token [" + token + "]. Please ensure that the appropriate Realm implementation is " + "configured correctly or that the realm accepts AuthenticationTokens of this type."; throw new UnsupportedTokenException(msg); } AuthenticationInfo info = realm.getAuthenticationInfo(token); if (info == null) { String msg = "Realm [" + realm + "] was unable to find account data for the " + "submitted AuthenticationToken [" + token + "]."; throw new UnknownAccountException(msg); } return info; }
/** * This method has protected visibility to allow for custom implementations * in the future that might obtain the list of roles for a principal from * somewhere other than Shiro's {@link RealmSecurityManager}. */ protected List<String> getRoles(final Subject subject, final AuthenticationToken token) { final List<String> roles = Lists.newArrayList(); RealmSecurityManager securityManager = getSecurityManager(); if(securityManager == null) { return roles; } final Set<String> realmNames = realmNamesOf(subject); final Collection<Realm> realms = securityManager.getRealms(); for (final Realm realm : realms) { // only obtain roles from those realm(s) that authenticated this subject if(!realmNames.contains(realm.getName())) { continue; } final AuthenticationInfo authenticationInfo = realm.getAuthenticationInfo(token); if(authenticationInfo instanceof AuthorizationInfo) { final AuthorizationInfo authorizationInfo = (AuthorizationInfo) authenticationInfo; final Collection<String> realmRoles = authorizationInfo.getRoles(); for (final String role : realmRoles) { roles.add(realm.getName() + ":" + role); } } } return roles; }
Throwable t = null; try { info = realm.getAuthenticationInfo(token); } catch (Throwable throwable) { t = throwable;