Oauth2 implementation with mongodb backend