Skip to content

Commit

Permalink
Fixed: bug in saml error handling (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
signebedi committed Apr 9, 2023
1 parent 3e8121a commit f21970b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ def create_app(test_config=None, celery_app=False, db_init_only=False):
# here we generate a SAML config, if SAML auth has been enabled in
# the app config
if config['saml_enabled']:
app.config['SAML_AUTH'], errors = verify_metadata( generate_saml_config(
app.config['SAML_AUTH'] = generate_saml_config(
domain=config['domain'],
idp_entity_id=config['idp_entity_id'],
idp_sso_url=config['idp_sso_url'],
Expand All @@ -395,7 +395,10 @@ def create_app(test_config=None, celery_app=False, db_init_only=False):
name_id_format=config['name_id_format'],
sp_x509_cert=config['sp_x509_cert'],
sp_private_key=config['sp_private_key'],
))
)

# here we pull for any errors to help with logging
metadata, errors = verify_metadata(app.config['SAML_AUTH'])

if len(errors) == 0:
log.info("LIBREFORMS - successfully loaded SAML config")
Expand Down

0 comments on commit f21970b

Please sign in to comment.