Added Oauth integration tests. Fixed related issues.

563u, 53i