Examples of AuthenticationServiceException


Examples of org.springframework.security.AuthenticationServiceException

                return new FacebookAuthenticationToken(userDetails.getAuthorities(),
                        token.getUserId(), token.getSessionKey());
            case failure:
                throw new BadCredentialsException("Log in failed - identity could not be verified");
            case error:
                throw new AuthenticationServiceException("Error message from server: " + token.getErrorMessage());
        }

        // unreachable
        return null;
    }
View Full Code Here

Examples of org.springframework.security.AuthenticationServiceException

    for ( GrantedAuthority authority : authenticate.getAuthorities() ) {
      if ( authority.getAuthority().equals( authenticatedRole ) ) {
        return authenticate;
      }
    }
    throw new AuthenticationServiceException( "The user doesn't have '" + authenticatedRole + "' role." );
  }
View Full Code Here

Examples of org.springframework.security.authentication.AuthenticationServiceException

  public Authentication attemptAuthentication(HttpServletRequest request,
      HttpServletResponse response) throws AuthenticationException {
//    System.err.println(" ---------------  MyAuthenticationFilter attemptAuthentication--------------- ");
   
    if (!request.getMethod().equals("POST")) {
      throw new AuthenticationServiceException(
          "Authentication method not supported: "
              + request.getMethod());
    }

    String username = obtainUsername(request).trim();
View Full Code Here

Examples of org.springframework.security.authentication.AuthenticationServiceException

            if (user == null) {
                cacheWasUsed = false;
                user = userDetailsService.loadUserByUsername(digestAuth.getUsername());

                if (user == null) {
                    throw new AuthenticationServiceException(
                            "AuthenticationDao returned null, which is an interface contract violation");
                }

                userCache.putUserInCache(user);
            }
View Full Code Here

Examples of org.springframework.security.authentication.AuthenticationServiceException

    //~ Methods ========================================================================================================

    public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) throws AuthenticationException {
        if (postOnly && !request.getMethod().equals("POST")) {
            throw new AuthenticationServiceException("Authentication method not supported: " + request.getMethod());
        }

        String username = obtainUsername(request);
        String password = obtainPassword(request);
View Full Code Here

Examples of org.springframework.security.authentication.AuthenticationServiceException

    }

    private static class NoOpAuthenticationManager implements AuthenticationManager {

        public Authentication authenticate(Authentication authentication) throws AuthenticationException {
            throw new AuthenticationServiceException("Cannot authenticate " + authentication);
        }
View Full Code Here

Examples of org.springframework.security.authentication.AuthenticationServiceException

        Method saltMethod = findSaltMethod(user);

        try {
            return saltMethod.invoke(user);
        } catch (Exception exception) {
            throw new AuthenticationServiceException(exception.getMessage(), exception);
        }
    }
View Full Code Here

Examples of org.springframework.security.authentication.AuthenticationServiceException

            if (pd != null) {
                saltMethod = pd.getReadMethod();
            }

            if (saltMethod == null) {
                throw new AuthenticationServiceException("Unable to find salt method on user Object. Does the class '" +
                    user.getClass().getName() + "' have a method or getter named '" + userPropertyToUse + "' ?");
            }
        }

        return saltMethod;
View Full Code Here

Examples of org.springframework.security.authentication.AuthenticationServiceException

                return createSuccessfulAuthentication(userDetails, response);

            } else if (status == OpenIDAuthenticationStatus.CANCELLED) {
                throw new AuthenticationCancelledException("Log in cancelled");
            } else if (status == OpenIDAuthenticationStatus.ERROR) {
                throw new AuthenticationServiceException("Error message from server: " + response.getMessage());
            } else if (status == OpenIDAuthenticationStatus.FAILURE) {
                throw new BadCredentialsException("Log in failed - identity could not be verified");
            } else if (status == OpenIDAuthenticationStatus.SETUP_NEEDED) {
                throw new AuthenticationServiceException(
                        "The server responded setup was needed, which shouldn't happen");
            } else {
                throw new AuthenticationServiceException("Unrecognized return value " + status.toString());
            }
        }

        return null;
    }
View Full Code Here

Examples of org.springframework.security.authentication.AuthenticationServiceException

*/
public class DefaultLoginExceptionResolver implements LoginExceptionResolver {
    //~ Methods ========================================================================================================

    public AuthenticationException resolveException(LoginException e) {
        return new AuthenticationServiceException(e.getMessage(), e);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.