diff --git a/ldapauthenticator/ldapauthenticator.py b/ldapauthenticator/ldapauthenticator.py index 222a96c..0edad82 100644 --- a/ldapauthenticator/ldapauthenticator.py +++ b/ldapauthenticator/ldapauthenticator.py @@ -3,7 +3,6 @@ import ldap3 from jupyterhub.auth import Authenticator from ldap3.utils.conv import escape_filter_chars -from tornado import gen from traitlets import Bool, Int, List, Unicode, Union, validate @@ -319,8 +318,7 @@ def get_user_attributes(self, conn, userdn): attrs = conn.entries[0].entry_attributes_as_dict return attrs - @gen.coroutine - def authenticate(self, handler, data): + async def authenticate(self, handler, data): """ Note: This function is really meant to identify a user, and check_allowed and check_blocked are meant to determine if its an @@ -455,6 +453,7 @@ def authenticate(self, handler, data): if __name__ == "__main__": + import asyncio import getpass c = LDAPAuthenticator() @@ -472,5 +471,5 @@ def authenticate(self, handler, data): username = input("Username: ") passwd = getpass.getpass() data = dict(username=username, password=passwd) - rs = c.authenticate(None, data) - print(rs.result()) + rs = asyncio.run(c.authenticate(None, data)) + print(rs) diff --git a/scripts b/scripts new file mode 100644 index 0000000..e69de29 diff --git a/setup.py b/setup.py index 4f99495..e5367b7 100644 --- a/setup.py +++ b/setup.py @@ -15,7 +15,6 @@ install_requires=[ "jupyterhub>=4.1.6", "ldap3", - "tornado", "traitlets", ], extras_require={