def authenticate(self, code, redirect_uri, client_secret=None):

        params = {
            "code": code,
            "client_id": self.client_id,
            "redirect_uri": redirect_uri,
            "grant_type": "authorization_code"
        }

        if client_secret is not None:
            params["client_secret"] = client_secret
        headers = {"Content-Type": "application/x-www-form-urlencoded"}
        response = self._http_provider.send(method="POST",
                                            headers=headers,
                                            url=self.AUTH_TOKEN_URL,
                                            data=params)

        rcont = json.loads(response.content)
        self._session = self._session_type(rcont["token_type"],
                                rcont["expires_in"],
                                rcont["scope"],
                                rcont["access_token"],
                                self.client_id,
                                self.AUTH_TOKEN_URL,
                                redirect_uri,
                                rcont["refresh_token"] if "refresh_token" in rcont else None,
                                client_secret)
Activable decorator overriding login_required
dataset/ETHPy150Open OneDrive/onedrive-sdk-python/src/onedrivesdk/auth_provider.py/AuthProvider.authenticate--crossover with--dataset/ETHPy150Open satnet-project/server/services/accounts/decorators.py/login_required