|
59 | 59 | c.KubeSpawner.args = ["--allow-root"] |
60 | 60 | c.JupyterHub.authenticator_class = CustomTokenAuthenticator |
61 | 61 | # TODO:Change this keycloak_url as required |
62 | | -c.CustomTokenAuthenticator.keycloak_url = "http://%s/realms/%s/" % ( |
63 | | - os.getenv("KEYCLOAK_HOSTNAME"), |
64 | | - os.getenv("KEYCLOAK_REALM"), |
65 | | -) |
| 62 | + |
66 | 63 | c.CustomTokenAuthenticator.auth_cookie_header = "Authorization" |
67 | 64 | c.CustomTokenAuthenticator.auth_username_key = "preferred_username" |
68 | 65 | c.CustomTokenAuthenticator.auth_uid_number_key = "uid_number" |
69 | 66 | c.CustomTokenAuthenticator.enable_auth_state = True |
70 | 67 | c.CustomTokenAuthenticator.auto_login = True |
71 | | -c.CustomTokenAuthenticator.landing_page_login_url = "https://" + os.getenv( |
72 | | - "KEYCLOAK_HOSTNAME" |
73 | | -) |
| 68 | + |
| 69 | +if os.getenv("PROD_DEPLOYMENT") == "true": |
| 70 | + c.CustomTokenAuthenticator.keycloak_url = "https://%s/realms/%s/" % ( |
| 71 | + os.getenv("KEYCLOAK_HOSTNAME"), |
| 72 | + os.getenv("KEYCLOAK_REALM"), |
| 73 | + ) |
| 74 | + c.CustomTokenAuthenticator.landing_page_login_url = "https://" + os.getenv( |
| 75 | + "KEYCLOAK_HOSTNAME" |
| 76 | + ) |
| 77 | + c.CustomTokenAuthenticator.landing_page_logout_url = ( |
| 78 | + "https://" + os.getenv("CLOWDER_URL") + "/auth/logout" |
| 79 | + ) |
| 80 | + |
| 81 | +else: |
| 82 | + c.CustomTokenAuthenticator.keycloak_url = "http://%s/realms/%s/" % ( |
| 83 | + os.getenv("KEYCLOAK_HOSTNAME"), |
| 84 | + os.getenv("KEYCLOAK_REALM"), |
| 85 | + ) |
| 86 | + c.CustomTokenAuthenticator.landing_page_login_url = "http://" + os.getenv( |
| 87 | + "KEYCLOAK_HOSTNAME" |
| 88 | + ) |
| 89 | + c.CustomTokenAuthenticator.landing_page_logout_url = ( |
| 90 | + "http://" + os.getenv("CLOWDER_URL") + "/auth/logout" |
| 91 | + ) |
74 | 92 |
|
75 | 93 | c.JupyterHub.cookie_secret = os.getenv("JUPYTERHUB_CRYPT_KEY") |
76 | 94 |
|
|
0 commit comments