diff --git a/docs/content/en/integrations/social-authentication.md b/docs/content/en/integrations/social-authentication.md index 09ad670db4c..95eead4add4 100644 --- a/docs/content/en/integrations/social-authentication.md +++ b/docs/content/en/integrations/social-authentication.md @@ -242,6 +242,8 @@ homepage](https://github.com/IdentityPython/djangosaml2). {{< highlight python >}} DD_SAML2_ENABLED=(bool, **True**), + # SAML Login Button Text + DD_SAML2_LOGIN_BUTTON_TEXT=(str, 'Login with SAML'), # If the metadata can be accessed from a url, try the DD_SAML2_METADATA_AUTO_CONF_URL=(str, ''), # Otherwise, downlaod a copy of the metadata into an xml file, and @@ -263,8 +265,7 @@ NOTE: *DD_SAML2_ATTRIBUTES_MAP* in k8s can be referenced as extraConfig (e.g. `D 4. Checkout the SAML section in dojo/`dojo/settings/settings.dist.py` and verfiy if it fits your requirement. If you need help, take a look at the [plugin documentation](https://djangosaml2.readthedocs.io/contents/setup.html#configuration). -5. Restart DefectDojo, and you should now see a **Login with SAML** - button on the login page. +5. Restart DefectDojo, and you should now see a **Login with SAML** button (default setting of DD_SAML2_LOGIN_BUTTON_TEXT) on the login page. NOTE: In the case when IDP is configured to use self signed (private) certificate, than CA needs to be specified by define environments variable diff --git a/dojo/context_processors.py b/dojo/context_processors.py index 95428b05036..3a72c172aa0 100644 --- a/dojo/context_processors.py +++ b/dojo/context_processors.py @@ -12,6 +12,7 @@ def globalize_oauth_vars(request): 'GITLAB_ENABLED': settings.GITLAB_OAUTH2_ENABLED, 'AZUREAD_TENANT_OAUTH2_ENABLED': settings.AZUREAD_TENANT_OAUTH2_ENABLED, 'SAML2_ENABLED': settings.SAML2_ENABLED, + 'SAML2_LOGIN_BUTTON_TEXT': settings.SAML2_LOGIN_BUTTON_TEXT, 'SAML2_LOGOUT_URL': settings.SAML2_LOGOUT_URL} diff --git a/dojo/settings/settings.dist.py b/dojo/settings/settings.dist.py index f1d3364fd84..51add5ba175 100644 --- a/dojo/settings/settings.dist.py +++ b/dojo/settings/settings.dist.py @@ -111,6 +111,7 @@ DD_SOCIAL_AUTH_GITLAB_API_URL=(str, 'https://gitlab.com'), DD_SOCIAL_AUTH_GITLAB_SCOPE=(list, ['api', 'read_user', 'openid', 'profile', 'email']), DD_SAML2_ENABLED=(bool, False), + DD_SAML2_LOGIN_BUTTON_TEXT=(str, 'Login with SAML'), # Optional: display the idp SAML Logout URL in DefectDojo DD_SAML2_LOGOUT_URL=(str, ''), # Metadata is required for SAML, choose either remote url or local file path @@ -759,6 +760,7 @@ def saml2_attrib_map_format(dict): SAML2_ENABLED = env('DD_SAML2_ENABLED') +SAML2_LOGIN_BUTTON_TEXT = env('DD_SAML2_LOGIN_BUTTON_TEXT') SAML2_LOGOUT_URL = env('DD_SAML2_LOGOUT_URL') if SAML2_ENABLED: import saml2 diff --git a/dojo/templates/dojo/login.html b/dojo/templates/dojo/login.html index cb62197bad3..031cc1bc029 100644 --- a/dojo/templates/dojo/login.html +++ b/dojo/templates/dojo/login.html @@ -73,7 +73,7 @@

Login

{% if SAML2_ENABLED is True %}
{% endif %}