diff --git a/setup.py b/setup.py index 60297f0..b30d9e0 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ setup( name="djangosaml2-spid", - version='1.1.3', + version='1.1.4', description="Djangosaml2 SPID Service Provider", long_description=README, long_description_content_type='text/markdown', diff --git a/src/djangosaml2_spid/conf.py b/src/djangosaml2_spid/conf.py index 96dc6e1..4baa941 100644 --- a/src/djangosaml2_spid/conf.py +++ b/src/djangosaml2_spid/conf.py @@ -217,6 +217,14 @@ }, ) +settings.SPID_ATTR_MAP_DIR = getattr( + settings, + "SPID_ATTR_MAP_DIR", + os.path.join( + djangosaml2_spid_config.path, "attribute_maps/" + ) +) + # Attributes that this project need to identify a user settings.SPID_REQUIRED_ATTRIBUTES = getattr( settings, @@ -282,10 +290,8 @@ def config_settings_loader(request: Optional[HttpRequest] = None) -> SPConfig: _OPTIONAL_ATTRIBUTES = [] saml_config = { - "entityid": metadata_url, - "attribute_map_dir": os.path.join( - djangosaml2_spid_config.path, "attribute_maps/" - ), + "entityid": getattr(settings, 'SAML2_ENTITY_ID', metadata_url), + "attribute_map_dir": settings.SPID_ATTR_MAP_DIR, "service": { "sp": { "name": metadata_url,