ntcredentials = (NTCredentials) credentials; } catch (ClassCastException e) { throw new InvalidCredentialsException( "Credentials cannot be used for NTLM authentication: " + credentials.getClass().getName());
System.out.println("ElastiCenter returned error code : " + response.getStatus()); if (401 == response.getStatus()) { throw new InvalidCredentialsException("Please specify a valid API Key."); } else if (431 == response.getStatus()) { throw new InvalidParameterException(response.getHeaders().getFirst("X-Description"));
/** * Produces JWT authorization header for the given set of {@link Credentials}. * * @param credentials * The set of credentials to be used for authentication * @param request * The request being authenticated * @throws org.apache.http.auth.InvalidCredentialsException * if authentication credentials are not valid or not applicable for this authentication scheme * @throws AuthenticationException * if authorization string cannot be generated due to an authentication failure * * @return a JWT authorization string */ @Override public Header authenticate(final Credentials credentials, final HttpRequest request, final HttpContext context) throws AuthenticationException { Args.notNull(credentials, "Credentials"); Args.notNull(request, "HTTP request"); if (credentials instanceof JwtCredentials) { return new BasicHeader(AUTH.WWW_AUTH_RESP, "Bearer " + ((JwtCredentials) credentials).getToken()); } else { throw new InvalidCredentialsException( "Credentials cannot be used for JWT authentication: " + credentials.getClass().getName()); } }
throw new InvalidCredentialsException(method.getStatusText());
if (gsse.getMajor() == GSSException.DEFECTIVE_CREDENTIAL || gsse.getMajor() == GSSException.CREDENTIALS_EXPIRED) throw new InvalidCredentialsException(gsse.getMessage(), gsse); if (gsse.getMajor() == GSSException.NO_CRED) throw new InvalidCredentialsException(gsse.getMessage(), gsse); if (gsse.getMajor() == GSSException.DEFECTIVE_TOKEN || gsse.getMajor() == GSSException.DUPLICATE_TOKEN
throw new InvalidCredentialsException( "Unsupported authentication scheme: " + scope.getScheme());
throw new InvalidCredentialsException( "Unsupported authentication scheme: " + scope.getScheme());
if (gsse.getMajor() == GSSException.DEFECTIVE_CREDENTIAL || gsse.getMajor() == GSSException.CREDENTIALS_EXPIRED) { throw new InvalidCredentialsException(gsse.getMessage(), gsse); throw new InvalidCredentialsException(gsse.getMessage(), gsse);
ntcredentials = (NTCredentials) credentials; } catch (ClassCastException e) { throw new InvalidCredentialsException( "Credentials cannot be used for NTLM authentication: " + credentials.getClass().getName());
ntcredentials = (NTCredentials) credentials; } catch (ClassCastException e) { throw new InvalidCredentialsException( "Credentials cannot be used for NTLM authentication: " + credentials.getClass().getName());
ntcredentials = (NTCredentials) credentials; } catch (ClassCastException e) { throw new InvalidCredentialsException( "Credentials cannot be used for NTLM authentication: " + credentials.getClass().getName());
throw new InvalidCredentialsException( "Credentials cannot be used for " + getSchemeName() + " authentication: " + credentials.getClass().getName());
ntcredentials = (NTCredentials) credentials; } catch (final ClassCastException e) { throw new InvalidCredentialsException( "Credentials cannot be used for NTLM authentication: " + credentials.getClass().getName());
ntcredentials = (NTCredentials) credentials; } catch (ClassCastException e) { throw new InvalidCredentialsException( "Credentials cannot be used for NTLM authentication: " + credentials.getClass().getName());
ntcredentials = (NTCredentials) credentials; } catch (final ClassCastException e) { throw new InvalidCredentialsException( "Credentials cannot be used for NTLM authentication: " + credentials.getClass().getName());
ntcredentials = (NTCredentials) credentials; } catch (final ClassCastException e) { throw new InvalidCredentialsException( "Credentials cannot be used for NTLM authentication: " + credentials.getClass().getName());
ntcredentials = (NTCredentials) credentials; } catch (final ClassCastException e) { throw new InvalidCredentialsException( "Credentials cannot be used for NTLM authentication: " + credentials.getClass().getName());
ntcredentials = (NTCredentials) credentials; } catch (final ClassCastException e) { throw new InvalidCredentialsException( "Credentials cannot be used for NTLM authentication: " + credentials.getClass().getName());
ntcredentials = (NTCredentials) credentials; } catch (final ClassCastException e) { throw new InvalidCredentialsException( "Credentials cannot be used for NTLM authentication: " + credentials.getClass().getName());
ntcredentials = (NTCredentials) credentials; } catch (final ClassCastException e) { throw new InvalidCredentialsException( "Credentials cannot be used for NTLM authentication: " + credentials.getClass().getName());