|
97 | 97 | BANNER_BOTTOM = ''
|
98 | 98 |
|
99 | 99 | # Text to include on the login page above the login form. HTML is allowed.
|
100 |
| -BANNER_LOGIN = 'Please log in with your CSH username and password' |
| 100 | +BANNER_LOGIN = '<script>window.location.replace("/oauth/login/oidc/" + window.location.search);</script>' |
101 | 101 |
|
102 | 102 | # Base URL path if accessing NetBox within a directory. For example, if installed at https://example.com/netbox/, set:
|
103 | 103 | # BASE_PATH = 'netbox/'
|
|
183 | 183 | "version": 1,
|
184 | 184 | "disable_existing_loggers": False,
|
185 | 185 | "handlers": {"console": {"class": "logging.StreamHandler"}},
|
186 |
| - "loggers": {"django_auth_ldap": {"level": "DEBUG", "handlers": ["console"]}}, |
| 186 | + "loggers": {"social_core": {"level": "DEBUG", "handlers": ["console"]}}, |
187 | 187 | } if DEBUG else {}
|
188 | 188 |
|
189 | 189 | # Automatically reset the lifetime of a valid session upon each authenticated request. Enables users to remain
|
|
275 | 275 |
|
276 | 276 | # Remote authentication support
|
277 | 277 | REMOTE_AUTH_ENABLED = True
|
278 |
| -REMOTE_AUTH_BACKEND = 'netbox.authentication.LDAPBackend' |
| 278 | +REMOTE_AUTH_BACKEND = 'social_core.backends.open_id_connect.OpenIdConnectAuth' |
279 | 279 | REMOTE_AUTH_HEADER = 'HTTP_REMOTE_USER'
|
280 | 280 | REMOTE_AUTH_AUTO_CREATE_USER = True
|
281 | 281 | REMOTE_AUTH_DEFAULT_GROUPS = []
|
282 | 282 | REMOTE_AUTH_DEFAULT_PERMISSIONS = {}
|
| 283 | +SOCIAL_AUTH_OIDC_ENDPOINT = 'https://sso.csh.rit.edu/auth/realms/csh' |
| 284 | +SOCIAL_AUTH_KEY = os.environ.get("OIDC_CLIENT_ID") |
| 285 | +SOCIAL_AUTH_SECRET = os.environ.get("OIDC_CLIENT_SECRET") |
| 286 | +SOCIAL_AUTH_NO_DEFAULT_PROTECTED_USER_FIELDS = True |
| 287 | +SOCIAL_AUTH_PROTECTED_USER_FIELDS = ( |
| 288 | + "id", |
| 289 | + "pk", |
| 290 | + "email", |
| 291 | + "password", |
| 292 | + "is_active", |
| 293 | + "is_staff", |
| 294 | + "is_superuser", |
| 295 | +) |
| 296 | + |
| 297 | +SOCIAL_AUTH_PIPELINE = ( |
| 298 | + 'social_core.pipeline.social_auth.social_details', |
| 299 | + 'social_core.pipeline.social_auth.social_uid', |
| 300 | + 'social_core.pipeline.social_auth.social_user', |
| 301 | + 'social_core.pipeline.user.get_username', |
| 302 | + 'social_core.pipeline.user.create_user', |
| 303 | + 'social_core.pipeline.social_auth.associate_user', |
| 304 | + 'netbox.authentication.user_default_groups_handler', |
| 305 | + 'social_core.pipeline.social_auth.load_extra_data', |
| 306 | + 'oidc_groups.oidc_groups_handler', |
| 307 | + 'social_core.pipeline.user.user_details', |
| 308 | +) |
283 | 309 |
|
284 | 310 | # This repository is used to check whether there is a new release of NetBox available. Set to None to disable the
|
285 | 311 | # version check or use the URL below to check for release in the official NetBox repository.
|
|
0 commit comments