mirror of https://github.com/jumpserver/jumpserver
feat: saml2协议单点登录支持在页面上配置saml2协议的高级配置 (#7362)
parent
84924bc3f6
commit
c5013dcbd6
|
@ -92,14 +92,11 @@ class PrepareRequestMixin:
|
|||
|
||||
@staticmethod
|
||||
def get_advanced_settings():
|
||||
other_settings = {}
|
||||
other_settings_path = settings.SAML2_OTHER_SETTINGS_PATH
|
||||
if os.path.exists(other_settings_path):
|
||||
with open(other_settings_path, 'r') as json_data:
|
||||
try:
|
||||
other_settings = json.loads(json_data.read())
|
||||
except Exception as error:
|
||||
logger.error('Get other settings error: %s', error)
|
||||
try:
|
||||
other_settings = dict(settings.SAML2_SP_ADVANCED_SETTINGS)
|
||||
except Exception as error:
|
||||
logger.error('Get other settings error: %s', error)
|
||||
other_settings = {}
|
||||
|
||||
default = {
|
||||
"organization": {
|
||||
|
|
|
@ -234,7 +234,7 @@ class Config(dict):
|
|||
'SAML2_LOGOUT_COMPLETELY': True,
|
||||
'AUTH_SAML2_ALWAYS_UPDATE_USER': True,
|
||||
'SAML2_RENAME_ATTRIBUTES': {'uid': 'username', 'email': 'email'},
|
||||
'SAML2_OTHER_SETTINGS_PATH': '',
|
||||
'SAML2_SP_ADVANCED_SETTINGS': {"organization": {"en": {"name": "JumpServer", "displayname": "JumpServer", "url": "https://jumpserver.org/"}}},
|
||||
'SAML2_IDP_METADATA_URL': '',
|
||||
'SAML2_IDP_METADATA_XML': '',
|
||||
'SAML2_SP_KEY_CONTENT': '',
|
||||
|
|
|
@ -129,7 +129,7 @@ AUTH_SAML2_AUTHENTICATION_FAILURE_REDIRECT_URI = CONFIG.AUTH_SAML2_AUTHENTICATIO
|
|||
AUTH_SAML2_ALWAYS_UPDATE_USER = CONFIG.AUTH_SAML2_ALWAYS_UPDATE_USER
|
||||
SAML2_LOGOUT_COMPLETELY = CONFIG.SAML2_LOGOUT_COMPLETELY
|
||||
SAML2_RENAME_ATTRIBUTES = CONFIG.SAML2_RENAME_ATTRIBUTES
|
||||
SAML2_OTHER_SETTINGS_PATH = CONFIG.SAML2_OTHER_SETTINGS_PATH
|
||||
SAML2_SP_ADVANCED_SETTINGS = CONFIG.SAML2_SP_ADVANCED_SETTINGS
|
||||
SAML2_LOGIN_URL_NAME = "authentication:saml2:saml2-login"
|
||||
SAML2_LOGOUT_URL_NAME = "authentication:saml2:saml2-logout"
|
||||
|
||||
|
|
|
@ -17,6 +17,9 @@ class SAML2SettingSerializer(serializers.Serializer):
|
|||
SAML2_IDP_METADATA_XML = serializers.CharField(
|
||||
allow_blank=True, required=False, label=_('IDP Metadata XML')
|
||||
)
|
||||
SAML2_SP_ADVANCED_SETTINGS = serializers.JSONField(
|
||||
required=False, label=_('SP ADVANCED SETTINGS')
|
||||
)
|
||||
SAML2_SP_KEY_CONTENT = serializers.CharField(
|
||||
allow_blank=True, required=False,
|
||||
write_only=True, label=_('SP Private Key')
|
||||
|
|
Loading…
Reference in New Issue