mirror of
https://github.com/cwinfo/powerdns-admin.git
synced 2024-11-14 01:20:27 +00:00
Allow specifying SAML2 SSO binding format.
This commit is contained in:
parent
20dcdbbb66
commit
2e96b41725
@ -19,6 +19,9 @@ if app.config['SAML_ENABLED']:
|
|||||||
from onelogin.saml2.idp_metadata_parser import OneLogin_Saml2_IdPMetadataParser
|
from onelogin.saml2.idp_metadata_parser import OneLogin_Saml2_IdPMetadataParser
|
||||||
idp_timestamp = datetime(1970, 1, 1)
|
idp_timestamp = datetime(1970, 1, 1)
|
||||||
idp_data = None
|
idp_data = None
|
||||||
|
if 'SAML_IDP_ENTITY_ID' in app.config:
|
||||||
|
idp_data = OneLogin_Saml2_IdPMetadataParser.parse_remote(app.config['SAML_METADATA_URL'], entity_id=app.config.get('SAML_IDP_ENTITY_ID', None), required_sso_binding=app.config['SAML_IDP_SSO_BINDING'])
|
||||||
|
else:
|
||||||
idp_data = OneLogin_Saml2_IdPMetadataParser.parse_remote(app.config['SAML_METADATA_URL'], entity_id=app.config.get('SAML_IDP_ENTITY_ID', None))
|
idp_data = OneLogin_Saml2_IdPMetadataParser.parse_remote(app.config['SAML_METADATA_URL'], entity_id=app.config.get('SAML_IDP_ENTITY_ID', None))
|
||||||
if idp_data is None:
|
if idp_data is None:
|
||||||
print('SAML: IDP Metadata initial load failed')
|
print('SAML: IDP Metadata initial load failed')
|
||||||
@ -37,6 +40,9 @@ def get_idp_data():
|
|||||||
|
|
||||||
def retreive_idp_data():
|
def retreive_idp_data():
|
||||||
global idp_data, idp_timestamp
|
global idp_data, idp_timestamp
|
||||||
|
if 'SAML_IDP_SSO_BINDING' in app.config:
|
||||||
|
new_idp_data = OneLogin_Saml2_IdPMetadataParser.parse_remote(app.config['SAML_METADATA_URL'], entity_id=app.config.get('SAML_IDP_ENTITY_ID', None), required_sso_binding=app.config['SAML_IDP_SSO_BINDING'])
|
||||||
|
else:
|
||||||
new_idp_data = OneLogin_Saml2_IdPMetadataParser.parse_remote(app.config['SAML_METADATA_URL'], entity_id=app.config.get('SAML_IDP_ENTITY_ID', None))
|
new_idp_data = OneLogin_Saml2_IdPMetadataParser.parse_remote(app.config['SAML_METADATA_URL'], entity_id=app.config.get('SAML_IDP_ENTITY_ID', None))
|
||||||
if new_idp_data is not None:
|
if new_idp_data is not None:
|
||||||
idp_data = new_idp_data
|
idp_data = new_idp_data
|
||||||
|
@ -98,6 +98,10 @@ SAML_METADATA_URL = 'https://<hostname>/FederationMetadata/2007-06/FederationMet
|
|||||||
#Cache Lifetime in Seconds
|
#Cache Lifetime in Seconds
|
||||||
SAML_METADATA_CACHE_LIFETIME = 1
|
SAML_METADATA_CACHE_LIFETIME = 1
|
||||||
|
|
||||||
|
# SAML SSO binding format to use
|
||||||
|
## Default: library default (urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect)
|
||||||
|
#SAML_IDP_SSO_BINDING = 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST'
|
||||||
|
|
||||||
## EntityID of the IdP to use. Only needed if more than one IdP is
|
## EntityID of the IdP to use. Only needed if more than one IdP is
|
||||||
## in the SAML_METADATA_URL
|
## in the SAML_METADATA_URL
|
||||||
### Default: First (only) IdP in the SAML_METADATA_URL
|
### Default: First (only) IdP in the SAML_METADATA_URL
|
||||||
|
Loading…
Reference in New Issue
Block a user