Implementation of Oauth2 for server side flow (authorization code)