UserAgent updates 

Improvements for authentication, also fixes https://github.com/dmwm/PHEDEX/issues/969 .