Implementation of an oauth2 provider