Add authentication support

Copied auth.py and oauth.py from the analytics repo.

Auditors: eater