diff --git a/jupyterhub/app.py b/jupyterhub/app.py index 7b81b040..2c306258 100644 --- a/jupyterhub/app.py +++ b/jupyterhub/app.py @@ -1222,6 +1222,7 @@ class JupyterHub(Application): client_id=service.oauth_client_id, client_secret=service.api_token, redirect_uri=service.oauth_redirect_uri, + description="JupyterHub service %s" % service.name, ) self._service_map[name] = service diff --git a/jupyterhub/oauth/store.py b/jupyterhub/oauth/store.py index 41a2a7a8..f41b2b39 100644 --- a/jupyterhub/oauth/store.py +++ b/jupyterhub/oauth/store.py @@ -195,10 +195,10 @@ class ClientStore(HubDBMixin, oauth2.store.ClientStore): redirect_uris=[orm_client.redirect_uri], secret=HashComparable(orm_client.secret), ) - - def add_client(self, client_id, client_secret, redirect_uri): + + def add_client(self, client_id, client_secret, redirect_uri, description=''): """Add a client - + hash its client_secret before putting it in the database. """ # clear existing clients with same ID @@ -212,6 +212,7 @@ class ClientStore(HubDBMixin, oauth2.store.ClientStore): identifier=client_id, secret=hash_token(client_secret), redirect_uri=redirect_uri, + description=description, ) self.db.add(orm_client) self.db.commit() @@ -222,7 +223,7 @@ def make_provider(session_factory, url_prefix, login_url): token_store = AccessTokenStore(session_factory) code_store = AuthCodeStore(session_factory) client_store = ClientStore(session_factory) - + provider = Provider( access_token_store=token_store, auth_code_store=code_store, diff --git a/jupyterhub/user.py b/jupyterhub/user.py index 5385df5e..5d63a217 100644 --- a/jupyterhub/user.py +++ b/jupyterhub/user.py @@ -381,6 +381,7 @@ class User: # containers that resume will be updated below client_store.add_client(client_id, api_token, url_path_join(self.url, server_name, 'oauth_callback'), + description="Server at %s" % url_path_join(self.url, server_name), ) db.commit()