diff --git a/src/config.yaml b/src/config.yaml index 2b0d1c5..0d455eb 100644 --- a/src/config.yaml +++ b/src/config.yaml @@ -5,6 +5,13 @@ options: description: | Protocol name to use for URL and generation. Must match the one that will be configured via OS-FEDERATION API. + entity-id-url: + type: string + default: + description: | + Optional field to provide the entity ID to be used in the service + provider metadata. If set to default (""), entity ID is generated + automatically. idp-name: type: string default: 'myidp' diff --git a/src/lib/charm/openstack/keystone_saml_mellon.py b/src/lib/charm/openstack/keystone_saml_mellon.py index e0f3522..bdb8a93 100644 --- a/src/lib/charm/openstack/keystone_saml_mellon.py +++ b/src/lib/charm/openstack/keystone_saml_mellon.py @@ -131,6 +131,15 @@ class KeystoneSAMLMellonConfigurationAdapter( def supported_nameid_formats(self): return self.nameid_formats.split(',') + @property + def entity_id(self): + if self.entity_id_url is None: + # Generate entity ID automatically + return '{}{}'.format(self.keystone_fid_service_provider.base_url, + self.sp_auth_path) + else + return self.entity_id_url + IDP_METADATA_INVALID = ('idp-metadata resource is not a well-formed' ' xml file') IDP_METADATA_URL_ERROR = ('an error has occurred during idp-metadata-url' diff --git a/src/templates/mellon-sp-metadata.xml b/src/templates/mellon-sp-metadata.xml index 93f5594..1b6b9e0 100644 --- a/src/templates/mellon-sp-metadata.xml +++ b/src/templates/mellon-sp-metadata.xml @@ -1,5 +1,5 @@