Skip to content

Conversation

@marcelhorner
Copy link

Description

When setting up DD_SECURE_SSL_REDIRECT to False and Azure auth, after login the redirect uses HTTP protocol by default. To enable DefectDojo to redirect with HTTPS protocol after login, which is required by Azure, we need to set SOCIAL_AUTH_REDIRECT_IS_HTTPS to True on Django framework.

This change adds the DD_SOCIAL_AUTH_REDIRECT_IS_HTTPS to to defectdojo\dojo\settings\settings.dist.py, making it possible to set SOCIAL_AUTH_REDIRECT_IS_HTTPS on Django framework.

Test results

I have a DefectDojo installation on a Kubernetes cluster. It was installed with helm and helm value file has DD_SECURE_SSL_REDIRECT: "False" config. After setting up auth on Azure I got an error about redirect not matching with Azure config.

After adding SOCIAL_AUTH_REDIRECT_IS_HTTPS var on defectdojo\dojo\settings\settings.dist.py and setting it to True on helm value file Azure auth proccess worked.

@github-actions github-actions bot added the settings_changes Needs changes to settings.py based on changes in settings.dist.py included in this PR label Nov 4, 2025
@valentijnscholten valentijnscholten added this to the 2.53.0 milestone Nov 4, 2025
Copy link
Member

@valentijnscholten valentijnscholten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Looks good. Could you add something like ", or set the `DD_SOCIAL_AUTH_REDIRECT_IS_HTTPS "
to:

If during the login process you get the following error: *The
'redirect_uri' parameter must be an absolute URI that is whitelisted
in the client app settings.* and the `redirect_uri` HTTP
GET parameter starts with `http://` instead of
`https://` you need to add
`SOCIAL_AUTH_REDIRECT_IS_HTTPS = True` to Docker environment variables, or to your `local_settings.py` file.

…hen using helm to docs (docs/content/en/customize_dojo/user_management/configure_sso.md).
@github-actions github-actions bot added the docs label Nov 4, 2025
@marcelhorner
Copy link
Author

Thanks! Looks good. Could you add something like ", or set the `DD_SOCIAL_AUTH_REDIRECT_IS_HTTPS " to:

If during the login process you get the following error: *The
'redirect_uri' parameter must be an absolute URI that is whitelisted
in the client app settings.* and the `redirect_uri` HTTP
GET parameter starts with `http://` instead of
`https://` you need to add
`SOCIAL_AUTH_REDIRECT_IS_HTTPS = True` to Docker environment variables, or to your `local_settings.py` file.

Done.

…hen using helm to docs (docs/content/en/customize_dojo/user_management/configure_sso.md).
Copy link
Member

@valentijnscholten valentijnscholten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry to hijack the PR, but I reworded the docs text to align with how we describe these in other places. Thanks for the PR and sharing this solution!

Copy link
Contributor

@mtesauro mtesauro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

'redirect_uri' parameter must be an absolute URI that is whitelisted
in the client app settings.* and the `redirect_uri` HTTP
GET parameter starts with `http://` instead of
`https://` you need to add
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the wording does not fit to the setting.
and the redirect_uri HTTP
GET parameter starts with https:// instead of
http:// you need to add
(because the DD_SOCIAL_AUTH_REDIRECT_IS_HTTPS=(bool, False))

And shouldn't we make this setting always to True just because DefectDojo is a security tool?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And shouldn't we make this setting always to True just because DefectDojo is a security tool?

No as the default is false from the lib. We want to avoid potentially breaking SSO for some folks

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds legit

@Maffooch Maffooch requested a review from Jino-T November 6, 2025 07:31
@valentijnscholten valentijnscholten merged commit 2f9a5aa into DefectDojo:dev Nov 6, 2025
151 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs settings_changes Needs changes to settings.py based on changes in settings.dist.py included in this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants