Skip to content

Commit

Permalink
define a shibboleth sso resource
Browse files Browse the repository at this point in the history
  • Loading branch information
Aethylred authored and Aaron Hicks committed Sep 29, 2014
1 parent e8f7566 commit f5523e7
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions manifests/mod/shib/sso.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
define apache::mod::shib::sso(
$discoveryURL = undef,
$idpURL = undef,
$discoveryProtocol = "SAMLDS"
){

require apache::mod::shib

info("The shibboleth configuration file is ${apache::mod::shib::shib_conf}")

if $discoveryURL and $idpURL {
err("apache::mod::shib::sso must have one of discoveryURL or idpURL set, not both.")
} elsif !$discoveryURL and !$idpURL {
err("apache::mod::shib::sso must have one of discoveryURL or idpURL set, not neither.")
} else {

if $idpURL {
$entityID_aug = "set SSO/#attribute/entityID ${idpURL}"
} else {
$entityID_aug = "rm SSO/#attribute/entityID"
}

info("The entityID augaes change is ${entityID_aug}")

augeas{"shib_SPconfig_sso_entityID":
lens => 'Xml.lns',
incl => $apache::mod::shib::shib_conf,
context => "/files${apache::mod::shib::shib_conf}/SPConfig/ApplicationDefaults/Sessions",
changes => [$entityID_aug,],
notify => Service['httpd'],
}

if $discoveryURL {
$discoveryURL_aug = "set SSO/#attribute/discoveryURL ${discoveryURL}"
} else {
$discoveryURL_aug = "rm SSO/#attribute/discoveryURL"
}

info("The discoveryURL augeas change is ${discoveryURL_aug}")

augeas{"shib_SPconfig_sso_discoveryURL":
lens => 'Xml.lns',
incl => $apache::mod::shib::shib_conf,
context => "/files${apache::mod::shib::shib_conf}/SPConfig/ApplicationDefaults/Sessions",
changes => [$discoveryURL_aug,],
notify => Service['httpd'],
}

augeas{"shib_SPconfig_sso_discoveryProtocol":
lens => 'Xml.lns',
incl => $apache::mod::shib::shib_conf,
context => "/files${apache::mod::shib::shib_conf}/SPConfig/ApplicationDefaults/Sessions",
changes => ["set SSO/#attribute/discoveryProtocol ${discoveryProtocol}",],
notify => Service['httpd'],
}
}
}

0 comments on commit f5523e7

Please sign in to comment.