Http auth token injector for existing app

Hi, can someone point me to an easy way to integrate my existing app with http authentication?
I already have an app that is built out that is calling RESTful Urls. While testing the app, I inserted ;auth=xxxxx tokens manually - those obviously expired after a while. What is the easiest way for a newbie
to add an http injector that takes care of auth insertion and login with the server in question whenever it expires?