Add two-legged auth support

Adds two legged auth support by being smarter about picking up auth parameters from the request or building them on the fly.

Fixes the broken behavior of adding all parameters to the Authorization header