Skip to content

Commit 2f9a5aa

Browse files
marcelhornerMarcel Hornervalentijnscholten
authored
Adding SOCIAL_AUTH_REDIRECT_IS_HTTPS, to enable use of HTTPS protocol when redirecting after login using social auth. (#13614)
* Adding SOCIAL_AUTH_REDIRECT_IS_HTTPS, to enable use of HTTPS protocol when redirecting after login. * Adding description about how to setup SOCIAL_AUTH_REDIRECT_IS_HTTPS when using helm to docs (docs/content/en/customize_dojo/user_management/configure_sso.md). * Adding description about how to setup SOCIAL_AUTH_REDIRECT_IS_HTTPS when using helm to docs (docs/content/en/customize_dojo/user_management/configure_sso.md). * Apply suggestion from @valentijnscholten --------- Co-authored-by: Marcel Horner <marcel.horner@stefanini.com> Co-authored-by: valentijnscholten <valentijnscholten@gmail.com>
1 parent d1d9676 commit 2f9a5aa

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

docs/content/en/customize_dojo/user_management/configure_sso.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ If during the login process you get the following error: *The
511511
in the client app settings.* and the `redirect_uri` HTTP
512512
GET parameter starts with `http://` instead of
513513
`https://` you need to add
514-
`SOCIAL_AUTH_REDIRECT_IS_HTTPS = True` to Docker environment variables, or to your `local_settings.py` file.
514+
`DD_SOCIAL_AUTH_REDIRECT_IS_HTTPS = True` to Docker Compose environment variables, or `SOCIAL_AUTH_REDIRECT_IS_HTTPS` to your `local_settings.py` file.
515515

516516
2. Restart DefectDojo, and 'Login With Okta' should appear on the login screen.
517517

dojo/settings/settings.dist.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@
115115
DD_SOCIAL_AUTH_CREATE_USER=(bool, True), # if True creates user at first login
116116
DD_SOCIAL_AUTH_CREATE_USER_MAPPING=(str, "username"), # could also be email or fullname
117117
DD_SOCIAL_LOGIN_AUTO_REDIRECT=(bool, False), # auto-redirect if there is only one social login method
118+
DD_SOCIAL_AUTH_REDIRECT_IS_HTTPS=(bool, False), # If true, the redirect after login will use the HTTPS protocol
118119
DD_SOCIAL_AUTH_TRAILING_SLASH=(bool, True),
119120
DD_SOCIAL_AUTH_OIDC_AUTH_ENABLED=(bool, False),
120121
DD_SOCIAL_AUTH_OIDC_OIDC_ENDPOINT=(str, ""),
@@ -576,6 +577,7 @@ def generate_url(scheme, double_slashes, user, password, host, port, path, param
576577
# Showing login form (form is not needed for external auth: OKTA, Google Auth, etc.)
577578
SHOW_LOGIN_FORM = env("DD_SOCIAL_AUTH_SHOW_LOGIN_FORM")
578579
SOCIAL_LOGIN_AUTO_REDIRECT = env("DD_SOCIAL_LOGIN_AUTO_REDIRECT")
580+
SOCIAL_AUTH_REDIRECT_IS_HTTPS = env("DD_SOCIAL_AUTH_REDIRECT_IS_HTTPS")
579581
SOCIAL_AUTH_CREATE_USER = env("DD_SOCIAL_AUTH_CREATE_USER")
580582
SOCIAL_AUTH_CREATE_USER_MAPPING = env("DD_SOCIAL_AUTH_CREATE_USER_MAPPING")
581583

0 commit comments

Comments
 (0)