Skip to content

Commit

Permalink
Merge pull request #30 from NetKnights-GmbH/26-update-config-template
Browse files Browse the repository at this point in the history
Update the UCS config templates
  • Loading branch information
nilsbehlen authored Feb 9, 2023
2 parents 6a86fca + f1c5a68 commit 55ed79a
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 40 deletions.
32 changes: 15 additions & 17 deletions conffiles-v1.9/etc/simplesamlphp/97authsources.php
Original file line number Diff line number Diff line change
@@ -1,28 +1,26 @@
// privacyIDEA authsource
@!@
url = configRegistry.get('privacyidea/saml/url', 'https://privacyidea')
privacyideaServerURL = configRegistry.get('privacyidea/saml/privacyideaServerURL', 'https://privacyidea')
realm = configRegistry.get('privacyidea/saml/realm', '')
verifyhost = configRegistry.get('privacyidea/saml/verifyhost', 'true')
verifypeer = configRegistry.get('privacyidea/saml/verifypeer', 'true')
doTriggerChallenge = configRegistry.get('privacyidea/saml/doTriggerChallenge', 'false')
serviceAccount = configRegistry.get('privacyidea/saml/serviceAccount', 'service')
servicePass = configRegistry.get('privacyidea/saml/servicePass', 'service')
doSendPassword = configRegistry.get('privacyidea/saml/doSendPassword', 'false')
otpFieldHint = configRegistry.get('privacyidea/saml/otpFieldHint', 'Please enter OTP')
passFieldHint = configRegistry.get('privacyidea/saml/passFieldHint', 'Please enter password')
sslVerifyHost = configRegistry.get('privacyidea/saml/sslVerifyHost', 'true')
sslVerifyPeer = configRegistry.get('privacyidea/saml/sslVerifyPeer', 'true')
authenticationFlow = configRegistry.get('privacyidea/saml/authenticationFlow', 'sendPass')
serviceAccount = configRegistry.get('privacyidea/saml/serviceAccount', '')
servicePass = configRegistry.get('privacyidea/saml/servicePass', '')
otpFieldHint = configRegistry.get('privacyidea/saml/otpFieldHint', 'Please enter the OTP')
passFieldHint = configRegistry.get('privacyidea/saml/passFieldHint', 'Please enter the Password')
SSO = configRegistry.get('privacyidea/saml/SSO', 'false')
preferredTokenType = configRegistry.get('privacyidea/saml/preferredTokenType', 'otp')
print("""
$config['privacyidea'] = array(
'privacyidea:PrivacyideaAuthSource',
'privacyideaServerURL' => '{url}',
'sslVerifyHost' => {verifyhost},
'sslVerifyPeer' => {verifypeer},
'privacyideaServerURL' => '{privacyideaServerURL}',
'sslVerifyHost' => {sslVerifyHost},
'sslVerifyPeer' => {sslVerifyPeer},
'realm' => '{realm}',
'doTriggerChallenge' => '{doTriggerChallenge}',
'authenticationFlow' => '{authenticationFlow}',
'serviceAccount' => '{serviceAccount}',
'servicePass' => '{servicePass}',
'doSendPassword' => '{doSendPassword}',
'otpFieldHint' => '{otpFieldHint}',
'passFieldHint' => '{passFieldHint}',
'SSO' => '{SSO}',
Expand All @@ -34,8 +32,8 @@
'phone' => 'telePhone',
'mobile' => 'mobilePhone'),
);
""".format(url=url, verifyhost=verifyhost.lower(), verifypeer=verifypeer.lower(), realm=realm,
doTriggerChallenge=doTriggerChallenge, serviceAccount=serviceAccount, servicePass=servicePass,
doSendPassword=doSendPassword, otpFieldHint=otpFieldHint, passFieldHint=passFieldHint,
""".format(privacyideaServerURL=privacyideaServerURL, sslVerifyHost=sslVerifyHost.lower(), sslVerifyPeer=sslVerifyPeer.lower(), realm=realm,
authenticationFlow=authenticationFlow, serviceAccount=serviceAccount, servicePass=servicePass,
otpFieldHint=otpFieldHint, passFieldHint=passFieldHint,
SSO=SSO.lower(), preferredTokenType=preferredTokenType))
@!@
42 changes: 19 additions & 23 deletions conffiles-v1.9/etc/simplesamlphp/metadata/97saml20-idp-hosted.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,16 @@
entity_id = configRegistry.get('saml/idp/entityID',
'https://{0!s}.{1!s}/simplesamlphp/saml2/idp/metadata.php'.format(hostname, domainname))

# Here default values are defined
url = configRegistry.get('privacyidea/saml/url', 'https://privacyidea')
verifyhost = configRegistry.get('privacyidea/saml/verifyhost', 'true')
verifypeer = configRegistry.get('privacyidea/saml/verifypeer', 'true')
# Here are defined the default values
privacyideaServerURL = configRegistry.get('privacyidea/saml/privacyideaServerURL', 'https://privacyidea')
sslVerifyHost = configRegistry.get('privacyidea/saml/sslVerifyHost', 'true')
sslVerifyPeer = configRegistry.get('privacyidea/saml/sslVerifyPeer', 'true')
enabledPath = configRegistry.get('privacyidea/saml/enabledPath', 'privacyIDEA')
enabledKey = configRegistry.get('privacyidea/saml/enabledKey', 'enabled')
doTriggerChallenge = configRegistry.get('privacyidea/saml/doTriggerChallenge', 'false')
serviceAccount = configRegistry.get('privacyidea/saml/serviceAccount', 'service')
servicePass = configRegistry.get('privacyidea/saml/servicePass', 'service')
doSendPassword = configRegistry.get('privacyidea/saml/doSendPassword', 'false')
otpFieldHint = configRegistry.get('privacyidea/saml/otpFieldHint', 'Please enter OTP')
passFieldHint = configRegistry.get('privacyidea/saml/passFieldHint', 'Please enter password')
authenticationFlow = configRegistry.get('privacyidea/saml/authenticationFlow', 'default')
serviceAccount = configRegistry.get('privacyidea/saml/serviceAccount', '')
servicePass = configRegistry.get('privacyidea/saml/servicePass', '')
otpFieldHint = configRegistry.get('privacyidea/saml/otpFieldHint', 'Please enter the OTP')
SSO = configRegistry.get('privacyidea/saml/SSO', 'false')
preferredTokenType = configRegistry.get('privacyidea/saml/preferredTokenType', 'otp')
doEnrollToken = configRegistry.get('privacyidea/saml/doEnrollToken', 'false')
Expand All @@ -31,7 +29,7 @@
excludeClientIPs = configRegistry.get('privacyidea/saml/excludeClientIPs', '')

realm = configRegistry.get('privacyidea/saml/realm', '')
uidKey = configRegistry.get('privacyidea/saml/uidkey', 'uid')
uidKey = configRegistry.get('privacyidea/saml/uidKey', 'uid')

enabled = configRegistry.get('privacyidea/saml/enable', 'false')

Expand All @@ -43,31 +41,29 @@
print("""
25 => array(
'class' => 'privacyidea:PrivacyideaAuthProc',
'privacyideaServerURL' => '{url}',
'privacyideaServerURL' => '{privacyideaServerURL}',
'realm' => '{realm}',
'uidKey' => '{uidKey}',
'sslVerifyHost' => '{verifyhost}',
'sslVerifyPeer' => '{verifypeer}',
'sslVerifyHost' => '{sslVerifyHost}',
'sslVerifyPeer' => '{sslVerifyPeer}',
'enabledPath' => '{enabledPath}',
'enabledKey' => '{enabledKey}',
'doTriggerChallenge' => '{doTriggerChallenge}',
'authenticationFlow' => '{authenticationFlow}',
'serviceAccount' => '{serviceAccount}',
'servicePass' => '{servicePass}',
'doSendPassword' => '{doSendPassword}',
'otpFieldHint' => '{otpFieldHint}',
'passFieldHint' => '{passFieldHint}',
'SSO' => '{SSO}',
'preferredTokenType' => '{preferredTokenType}',
'doEnrollToken' => '{doEnrollToken}',
'tokenType' => '{tokenType}',
'tryFirstAuthentication' => '{tryFirstAuthentication}',
'tryFirstAuthPass' => '{tryFirstAuthPass}',
""".format(url=url, realm=realm, uidKey=uidKey, verifyhost=verifyhost.lower(), verifypeer=verifypeer.lower(),
enabledPath=enabledPath, enabledKey=enabledKey, doTriggerChallenge=doTriggerChallenge.lower(),
serviceAccount=serviceAccount, servicePass=servicePass, doSendPassword=doSendPassword,
otpFieldHint=otpFieldHint, passFieldHint=passFieldHint, SSO=SSO.lower(), preferredTokenType=preferredTokenType,
doEnrollToken=doEnrollToken, tokenType=tokenType, tryFirstAuthentication=tryFirstAuthentication.lower(),
tryFirstAuthPass=tryFirstAuthPass))
""".format(privacyideaServerURL=privacyideaServerURL, realm=realm, uidKey=uidKey, sslVerifyHost=sslVerifyHost.lower(),
sslVerifyPeer=sslVerifyPeer.lower(), enabledPath=enabledPath, enabledKey=enabledKey,
authenticationFlow=authenticationFlow, serviceAccount=serviceAccount, servicePass=servicePass,
otpFieldHint=otpFieldHint, SSO=SSO.lower(), preferredTokenType=preferredTokenType,
doEnrollToken=doEnrollToken, tokenType=tokenType,
tryFirstAuthentication=tryFirstAuthentication.lower(), tryFirstAuthPass=tryFirstAuthPass))

if excludeClientIPs != '':
print("""
Expand Down

0 comments on commit 55ed79a

Please sign in to comment.