Z2jh with custom lti1.3 authentication (moodle integration)

Hello,

here is my config file:

hub:
  extraConfig:
    01-extra-config: |
        c.JupyterHub.authenticator_class = "ltiauthenticator.lti13.auth.LTI13Authenticator"
        c.LTI13Authenticator.issuer = "xxxx"
        c.LTI13Authenticator.authorize_url = "xxxx"
        c.LTI13Authenticator.jwks_endpoint = "xxxx"
        c.LTI13Authenticator.client_id = "xxxx"
        c.LTI13Authenticator.username_key = "email"

I would like to inherit from LTI13Authenticator and create a custom lti class to overwrite the normalize_username method. Does anyone has any idea?
when I try to import, it gives error:

import ltiauthenticator
class MyLTI13Authenticator(ltiauthenticator.lti13.auth.LTI13Authenticator):
          def normalize_username(self, username):
            return username.lower().replace("@","-").replace(".","-")

here is error:

AttributeError: module 'ltiauthenticator.lti13' has no attribute 'auth'

best regards

This should be ltiauthenticator.lti13.LTI13Authenticator without auth.

1 Like

it gave me the same error:
ltiauthenticator.lti13 doesn’t have such attribute as LTI13Authenticator

I had to download the source code and modify it.