Implement OAuth based on https://github.com/prose/gatekeeper

Closes #1