|
21 | 21 | internal_attribute_name: idpdisplayname
|
22 | 22 | # Language preference with 'en' or English as default
|
23 | 23 | lang: en
|
| 24 | + entity_id: |
| 25 | + internal_attribute_name: idpentityid |
24 | 26 | organization_name:
|
25 | 27 | internal_attribute_name: idporgname
|
26 | 28 | lang: en
|
|
45 | 47 | import satosa.micro_services.base
|
46 | 48 | from satosa.logging_util import satosa_logging
|
47 | 49 | from satosa.exception import SATOSAError
|
| 50 | +from satosa.context import Context |
48 | 51 |
|
49 | 52 | import copy
|
50 | 53 | import logging
|
@@ -159,15 +162,22 @@ def process(self, context, data):
|
159 | 162 |
|
160 | 163 | satosa_logging(logger, logging.DEBUG, "Using config {}".format(config), context.state)
|
161 | 164 |
|
| 165 | + # Log the entityID of the authenticating IdP. |
| 166 | + satosa_logging(logger, logging.INFO, "entityID for authenticating IdP is {}".format(idp_entity_id), context.state) |
| 167 | + |
162 | 168 | # Ignore this IdP if so configured.
|
163 | 169 | if config['ignore']:
|
164 | 170 | satosa_logging(logger, logging.INFO, "Ignoring IdP {}".format(idp_entity_id), context.state)
|
165 | 171 | return super().process(context, data)
|
166 | 172 |
|
| 173 | + # Set the entityID attribute if so configured. |
| 174 | + if 'entity_id' in config: |
| 175 | + data.attributes[config['entity_id']['internal_attribute_name']] = idp_entity_id |
| 176 | + |
167 | 177 | # Get the metadata store the SP for the proxy is using. This
|
168 | 178 | # will be an instance of the class MetadataStore from mdstore.py
|
169 | 179 | # in pysaml2.
|
170 |
| - metadata_store = context.internal_data['metadata_store'] |
| 180 | + metadata_store = context.get_decoration(Context.KEY_BACKEND_METADATA_STORE) |
171 | 181 |
|
172 | 182 | # Get the metadata for the IdP.
|
173 | 183 | try:
|
|
0 commit comments