@@ -225,7 +225,6 @@ def list_env(key):
225225# It w't be used since we override get_token() to use private key JWT
226226OIDC_RP_CLIENT_SECRET = "not-used-private-key-jwt"
227227OIDC_RP_CLIENT_PRIVATE_KEY = environ .get ("OIDC_RP_CLIENT_PRIVATE_KEY" )
228- # OIDC_RP_CLIENT_KEY_ID = environ.get("OIDC_RP_CLIENT_KEY_ID")
229228OIDC_OP_FQDN = environ .get ("OIDC_OP_FQDN" )
230229OIDC_OP_AUTHORIZATION_ENDPOINT = f"{ OIDC_OP_FQDN } /authorize"
231230OIDC_OP_TOKEN_ENDPOINT = f"{ OIDC_OP_FQDN } /token"
@@ -248,17 +247,9 @@ def list_env(key):
248247LOGIN_REDIRECT_URL = '/'
249248LOGOUT_REDIRECT_URL = '/'
250249
251- # Session configuration for OIDC
252- # Ensure sessions work properly for OIDC callback
253- SESSION_COOKIE_SECURE = not DEBUG # Only use secure cookies in production
254- SESSION_COOKIE_HTTPONLY = True # Prevent JavaScript access (XSS protection)
255- SESSION_COOKIE_SAMESITE = 'Lax' # CSRF protection, allows OIDC redirects
256- SESSION_SAVE_EVERY_REQUEST = True # Ensure session is saved
257250
258251# Additional security settings for production
259252if not DEBUG :
260- SECURE_SSL_REDIRECT = True # Redirect HTTP to HTTPS
261- SECURE_HSTS_SECONDS = 31536000 # 1 year
262- SECURE_HSTS_INCLUDE_SUBDOMAINS = True
263- SECURE_HSTS_PRELOAD = True
264- SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO' , 'https' )
253+ SECURE_SSL_REDIRECT = False
254+ SESSION_COOKIE_SECURE = True
255+
0 commit comments