def make_provider(session_factory, url_prefix, login_url, **oauth_server_kwargs):
    """Make an OAuth provider"""
    db = session_factory()
    validator = JupyterHubRequestValidator(db)
    server = JupyterHubOAuthServer(db, validator, **oauth_server_kwargs)
    return server
Make an OAuth provider
jupyterhub/oauth/provider.py