1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
diff --git a/mint/settings.py b/mint/settings.py
index 69fdc4ef6cb498d9d5cced5a9a333b5d95419e8f..a0f786dec3cd4b6c421952c79eba0afa50ca1df4 100644
--- a/mint/settings.py
+++ b/mint/settings.py
@@ -11,7 +11,7 @@ SECRET_KEY = env.str("SECRET_KEY")
DEBUG = env.bool("DEBUG", False)
-ALLOWED_HOSTS = ["localhost", "dev.jolheiser.com"]
+ALLOWED_HOSTS = ["*"]
INSTALLED_APPS = [
"django.contrib.admin",
@@ -45,7 +45,7 @@ "OPTIONS": {
"context_processors": [
"django.template.context_processors.request",
"django.contrib.auth.context_processors.auth",
- "django.contrib.messages.context_processors.messages"
+ "django.contrib.messages.context_processors.messages",
],
},
},
@@ -85,20 +85,24 @@ SESSION_COOKIE_NAME = "mint_sessionid"
SESSION_COOKIE_SECURE = not DEBUG
discovery_url = env.str("OIDC_CONFIG_URL")
-resp = requests.get(discovery_url).json()
+resp: dict = {}
+if discovery_url:
+ resp = requests.get(discovery_url).json()
OIDC_RP_CLIENT_ID = env.str("OIDC_CLIENT_ID")
OIDC_RP_CLIENT_SECRET = env.str("OIDC_CLIENT_SECRET")
OIDC_RP_SIGN_ALGO = "RS256"
-OIDC_OP_AUTHORIZATION_ENDPOINT = resp["authorization_endpoint"]
-OIDC_OP_USER_ENDPOINT = resp["userinfo_endpoint"]
-OIDC_OP_TOKEN_ENDPOINT = resp["token_endpoint"]
-OIDC_OP_JWKS_ENDPOINT = resp["jwks_uri"]
+OIDC_OP_AUTHORIZATION_ENDPOINT = resp.get("authorization_endpoint", "")
+OIDC_OP_USER_ENDPOINT = resp.get("userinfo_endpoint", "")
+OIDC_OP_TOKEN_ENDPOINT = resp.get("token_endpoint", "")
+OIDC_OP_JWKS_ENDPOINT = resp.get("jwks_uri", "")
OIDC_RP_SCOPES = "openid email profile groups"
if DEBUG:
INTERNAL_IPS = ["127.0.0.1"]
- TEMPLATES[0]["OPTIONS"]["context_processors"].append("django.template.context_processors.debug")
+ TEMPLATES[0]["OPTIONS"]["context_processors"].append(
+ "django.template.context_processors.debug"
+ )
try:
import debug_toolbar
|