Support oauth

Cherry picked from #5. 

- [ ] Add specs
- [ ] Check readme examples are up to date