private boolean checkAuthorization(Header clientAuth) {
// TODO Auto-generated method stub
BasicScheme scheme;
try {
scheme = new BasicScheme("basic realm=test");
String expectedAuthString = scheme.authenticate(credentials, null, null);
return expectedAuthString.equals(clientAuth.getValue());
} catch (MalformedChallengeException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (AuthenticationException e) {