    def token_for_code(self, code, *, sync=True):
        """Get token for OAuth temporary code

        This is the last step of OAuth login.
        Should be called in OAuth Callback handler.

        Args:
            code (str): oauth code for finishing OAuth login
        Returns:
            token (str): JupyterHub API Token
        """
        return self._call_coroutine(sync, self._token_for_code, code)
Get token for OAuth temporary code

This is the last step of OAuth login.
Should be called in OAuth Callback handler.

Args:
code (str): oauth code for finishing OAuth login
Returns:
token (str): JupyterHub API Token
jupyterhub/services/auth.py