Authorization required error when accessing bitcoin using json RPC
Figured it out. Turns out that (at least on Bitcoind 0.8.1 on Ubuntu), specifying the conf file when starting bitcoind doesn't do anything. I was starting it with:


bitcoind -daemon -conf=./bitcoin.conf 


from a bitcoin directory I had created /home/vijay/btc/. But bitcoind automatically uses the conf file in ~/.bitcoin/bitcoin.conf and mine was being completely ignored. Not sure what the point of the "-conf" option is!

So the solution was just to add my rpc username and password to the default conf file, which fixed the authorization failed error.