Skip to content

Commit

Permalink
Merge pull request #97 from forza-mor-rotterdam/admin-url
Browse files Browse the repository at this point in the history
admin url
  • Loading branch information
mguikema authored Oct 25, 2023
2 parents e101c42 + 1dbab94 commit 1822604
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
5 changes: 2 additions & 3 deletions app/config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,9 @@
except Exception as e:
logger.error(f"OPENID_CONFIG FOUT, url: {OPENID_CONFIG_URI}, error: {e}")

OIDC_ENABLED = False
if OPENID_CONFIG and OIDC_RP_CLIENT_ID:
OIDC_ENABLED = True
OIDC_VERIFY_SSL = os.getenv("OIDC_VERIFY_SSL", True) in TRUE_VALUES
OIDC_USE_NONCE = os.getenv("OIDC_USE_NONCE", True) in TRUE_VALUES

Expand All @@ -379,9 +381,6 @@
OIDC_OP_JWKS_ENDPOINT = os.getenv(
"OIDC_OP_JWKS_ENDPOINT", OPENID_CONFIG.get("jwks_uri")
)
CHECK_SESSION_IFRAME = os.getenv(
"CHECK_SESSION_IFRAME", OPENID_CONFIG.get("check_session_iframe")
)
OIDC_RP_SCOPES = os.getenv(
"OIDC_RP_SCOPES",
" ".join(OPENID_CONFIG.get("scopes_supported", ["openid", "email", "profile"])),
Expand Down
9 changes: 7 additions & 2 deletions app/config/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
path("api/v1/", include((router.urls, "app"), namespace="v1")),
path("api-token-auth/", views.obtain_auth_token),
path("oidc/", include("mozilla_django_oidc.urls")),
path("admin/", admin.site.urls),
path("", root, name="root"),
path("melding/aanmaken", melding_aanmaken, name="melding_aanmaken"),
path(
Expand Down Expand Up @@ -61,8 +60,9 @@
),
]

if settings.OPENID_CONFIG and settings.OIDC_RP_CLIENT_ID:
if settings.OIDC_ENABLED:
urlpatterns += [
path("oidc/", include("mozilla_django_oidc.urls")),
path(
"admin/login/",
RedirectView.as_view(
Expand All @@ -79,6 +79,11 @@
),
name="admin_logout",
),
path("admin/", admin.site.urls),
]
else:
urlpatterns += [
path("admin/", admin.site.urls),
]

if settings.DEBUG:
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ services:
- mbc_network
- mor_bridge_network
command: ["bash", "/app/deploy/docker-entrypoint.development.sh"]
restart: always

redis:
image: redis
Expand Down

0 comments on commit 1822604

Please sign in to comment.