The changes to add auth are in the link below. Manually tested only. Returns the string "Unauthorized" if the user is unauthorized (no username or wrong password), otherwise returns the desired json. Credit must go to the author of txjsonrpc for including a nice wrapper for auth.