Begin refactor of oauth flow on the server