Crude implementation of oauth2 flow.