Not rediecting to Jupyterlab while login

Hi,
I am deploying jupyterhub 2.0.0 with jupyterlab on kubernetes and integrating jupyterhub with ldap to login. While login jupyterhub redict me to (as mentioned in image). then i have to manually append lab at the end to access lab. Why is it not automatically forwarding it to lab and how can i do it?

Hello, @mr_goyal

It would help to show your configuration, building environment, and logs.

This is my LDAP setting. I hope this configuration may help.

debug:
  enabled: true
hub:
  db:
    pvc:
      storageClassName: jhdb

  config:
    Authenticator:
      enable_auth_state: true
    JupyterHub:
      authenticator_class: ldapauthenticator.LDAPAuthenticator
    # https://github.com/manics/zero-to-jupyterhub-k8s-examples/blob/fc75009b7e0729bb9537f7f4cb745292692cf0d2/ldap-singleuser/jupyterhub.yml
    LDAPAuthenticator:
      server_address: ldapserver
      lookup_dn: True
      bind_dn_template:
        - cn={username},dc=example,dc=com
      user_search_base: "dc=example,dc=com"
      user_attribute: cn
      lookup_dn_user_dn_attribute: cn
      escape_userdn: True
      use_ssl: true
      auth_state_attributes: ["uid", "uidNumber", "gidNumber", "homeDirectory"]
      use_lookup_dn_username: False
  extraConfig:
    SpawnerCustomConfig: |
      from ldapauthenticator import LDAPAuthenticator
      from hashlib import md5

      class LDAPAuthenticatorInfo(LDAPAuthenticator):
          async def pre_spawn_start(self, user, spawner):
              auth_state = await user.get_auth_state()

              if not auth_state:
                  return

              # https://github.com/jupyter/docker-stacks/blob/fde8f1eec3e70edf67560b5430545a22382334bf/base-notebook/start.sh#L41-L102
              spawner.environment["NB_UID"]  = str(auth_state["uidNumber"][0])
              ##spawner.environment["NB_USER"] = auth_state["uid"][0]
              spawner.environment["NB_GID"]  = str(auth_state["gidNumber"][0])
              spawner.environment["CHOWN_HOME"]  = "yes"
              spawner.environment["NB_UMASK"]  = "077"

      c.JupyterHub.authenticator_class = LDAPAuthenticatorInfo

    CustomHubConfig: |
      c.JupyterHub.cleanup_servers = True

singleuser:
  cmd: # need empty
  uid: 0
  image:
    name: 'my.docker.repo/jupyter'
    tag: 'latest'
  storage:
    type: static
    static:
      pvcName: pvc-home
      subPath: "{unescaped_username}" # https://discourse.jupyter.org/t/uri-encoding-character-in-the-ldap-authentication/22873/3

proxy:
  https:
    enabled: true
    type: manual
    manual:
      key: |
        ## certificates

Please see also.

JupyterHub 2.0 is quite old. Could you try with JupyterHub 4.0? In any case, I guess the config you are missing is c.Spawner.default_url = "/lab"

2 Likes