/* This function performs the decoding of the authentication header */
  public void decodeAuthorizationHeader() {
    // check if this request has basic authentication
    if (!authHeader.contains("Basic ")) {
      throw new WebApplicationException(Response.Status.BAD_REQUEST);
    }

    authHeader = authHeader.substring("Basic ".length());
    String[] decodedHeader;
    decodedHeader = Base64.base64Decode(authHeader).split(":");

    if (decodedHeader == null) {
      throw new WebApplicationException(Response.Status.BAD_REQUEST);
    }

    oAuthenticationAccount.setusername(decodedHeader[0]);
    oAuthenticationAccount.setpassword(decodedHeader[1]);
  }