throw new AuthenticationException("The requested password check mode '" + pmode_plain + "' is not a valid mode. Possible values are " + mode_values); CharSequence user = credentials.get(USERNAME_KEY); if (null == user) throw new AuthenticationException("Authentication request was missing the required key '" + USERNAME_KEY + "'"); else CharSequence pass = credentials.get(PASSWORD_KEY); if (null == pass) throw new AuthenticationException("Authentication request was missing the required key '" + PASSWORD_KEY + "'"); else throw new AuthenticationException(authenticationErrorMessage(mode, username)); switch (mode) throw new AuthenticationException(authenticationErrorMessage(mode, username));
public static AuthenticationException toThrift(org.apache.cassandra.exceptions.AuthenticationException e) { return new AuthenticationException(e.getMessage()); }
public AuthenticatedUser getAuthenticatedUser() throws AuthenticationException { if (!complete) throw new AuthenticationException("SASL negotiation not complete"); return authenticate(username, password); }
public static AuthenticationException toThrift(org.apache.cassandra.exceptions.AuthenticationException e) { return new AuthenticationException(e.getMessage()); }
public AuthenticatedUser getAuthenticatedUser() throws AuthenticationException { if (!complete) throw new AuthenticationException("SASL negotiation not complete"); return authenticate(username, password); }
public static AuthenticationException toThrift(org.apache.cassandra.exceptions.AuthenticationException e) { return new AuthenticationException(e.getMessage()); }
public AuthenticatedUser getAuthenticatedUser() throws AuthenticationException { if (!complete) throw new AuthenticationException("SASL negotiation not complete"); return authenticate(username, password); }
throw new FailedLoginException(e.getMessage());
public AuthenticatedUser legacyAuthenticate(Map<String, String> credentials) throws AuthenticationException { String username = credentials.get(USERNAME_KEY); if (username == null) throw new AuthenticationException(String.format("Required key '%s' is missing", USERNAME_KEY)); String password = credentials.get(PASSWORD_KEY); if (password == null) throw new AuthenticationException(String.format("Required key '%s' is missing for provided username %s", PASSWORD_KEY, username)); return authenticate(username, password); }
throw new FailedLoginException(e.getMessage());
public AuthenticatedUser legacyAuthenticate(Map<String, String> credentials) throws AuthenticationException { String username = credentials.get(USERNAME_KEY); if (username == null) throw new AuthenticationException(String.format("Required key '%s' is missing", USERNAME_KEY)); String password = credentials.get(PASSWORD_KEY); if (password == null) throw new AuthenticationException(String.format("Required key '%s' is missing for provided username %s", PASSWORD_KEY, username)); return authenticate(username, password); }
throw new FailedLoginException(e.getMessage());
public AuthenticatedUser legacyAuthenticate(Map<String, String> credentials) throws AuthenticationException { String username = credentials.get(USERNAME_KEY); if (username == null) throw new AuthenticationException(String.format("Required key '%s' is missing", USERNAME_KEY)); String password = credentials.get(PASSWORD_KEY); if (password == null) throw new AuthenticationException(String.format("Required key '%s' is missing for provided username %s", PASSWORD_KEY, username)); return authenticate(username, password); }
throw new AuthenticationException("Password must not be null"); if (user == null) throw new AuthenticationException("Authentication ID must not be null");
throw new AuthenticationException("Password must not be null"); if (user == null) throw new AuthenticationException("Authentication ID must not be null");
throw new AuthenticationException("Password must not be null"); if (user == null) throw new AuthenticationException("Authentication ID must not be null");
private AuthenticatedUser authenticate(String username, String password) throws AuthenticationException { try { String hash = cache.get(username); if (!checkpw(password, hash)) throw new AuthenticationException(String.format("Provided username %s and/or password are incorrect", username)); return new AuthenticatedUser(username); } catch (ExecutionException | UncheckedExecutionException e) { // the credentials were somehow invalid - either a non-existent role, or one without a defined password if (e.getCause() instanceof NoSuchCredentialsException) throw new AuthenticationException(String.format("Provided username %s and/or password are incorrect", username)); // an unanticipated exception occured whilst querying the credentials table if (e.getCause() instanceof RequestExecutionException) { logger.trace("Error performing internal authentication", e); throw new AuthenticationException(String.format("Error during authentication of user %s : %s", username, e.getMessage())); } throw new RuntimeException(e); } }
private AuthenticatedUser authenticate(String username, String password) throws AuthenticationException { try { String hash = cache.get(username); if (!checkpw(password, hash)) throw new AuthenticationException(String.format("Provided username %s and/or password are incorrect", username)); return new AuthenticatedUser(username); } catch (ExecutionException | UncheckedExecutionException e) { // the credentials were somehow invalid - either a non-existent role, or one without a defined password if (e.getCause() instanceof NoSuchCredentialsException) throw new AuthenticationException(String.format("Provided username %s and/or password are incorrect", username)); // an unanticipated exception occured whilst querying the credentials table if (e.getCause() instanceof RequestExecutionException) { logger.trace("Error performing internal authentication", e); throw new AuthenticationException(String.format("Error during authentication of user %s : %s", username, e.getMessage())); } throw new RuntimeException(e); } }
throw new AuthenticationException("Authentication ID must not be null"); if (pass == null) throw new AuthenticationException("Password must not be null");
private AuthenticatedUser authenticate(String username, String password) throws AuthenticationException { try { String hash = cache.get(username); if (!checkpw(password, hash)) throw new AuthenticationException(String.format("Provided username %s and/or password are incorrect", username)); return new AuthenticatedUser(username); } catch (ExecutionException | UncheckedExecutionException e) { // the credentials were somehow invalid - either a non-existent role, or one without a defined password if (e.getCause() instanceof NoSuchCredentialsException) throw new AuthenticationException(String.format("Provided username %s and/or password are incorrect", username)); // an unanticipated exception occured whilst querying the credentials table if (e.getCause() instanceof RequestExecutionException) { logger.trace("Error performing internal authentication", e); throw new AuthenticationException(String.format("Error during authentication of user %s : %s", username, e.getMessage())); } throw new RuntimeException(e); } }