This page describes very briefly how to combine the Géant Attribute Checker and Lindat’s Attribute Aggregator together. It assumes that the reader is already familiar with both technologies and serves only as quick how-to.
This quick how-to uses kielipankki.fi as an example.
You need
Since both tools use the ”sessionHook” of Shibboleth, the idea is to daisy chain both tools.
Configure the file according to the instructions in Github.
Set the sessionHook to the glue code HTML that calls aaggr.js, again kielipankki as an example. Note that this deviates from the instructions for the Attribute Checker alone.
<ApplicationDefaults entityID="https://sp.www.kielipankki.fi/" REMOTE_USER="eppn persistent-id targeted-id" metadataAttributePrefix="Meta-" sessionHook="/attr.html" signing="front" encryption="false">
Set a Session Handler within the Sessions Element. Note other Handlers in ”Sessions” have been removed for clarity, so copy/paste only the Handler and add it to the Sessions element.
Note the example below assumes only eppn to check for.
<Sessions lifetime="28800" timeout="3600" relayState="ss:mem" checkAddress="false" handlerSSL="true" cookieProps="https"> <!-- Geant Attribute Checker --> <Handler type="AttributeChecker" Location="/AttrChecker" template="attrChecker.html" attributes="eppn" flushSession="true"/> </Sessions>
Add the glue code (this one contains the original documentation):
<html>
<!– This page glues together Lindat’s aaggreg Attribute statistic
tool and the Geant’s attribute Checker. It works client side and
therefore is not the fastest solution. You need to
* direct Shibboleth sessionHook to this page, eg. /attr.html
* redirect to AttrChecker in aaggr.js after attributes are sent.
References
* https://github.com/ufal/clarin-sp-aaggregator
* https://wiki.edugain.org/How_to_configure_Shibboleth_SP_attribute_checker –>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=UTF-8″/>
<script type=’text/javascript’ src=’//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js’></script>
<script type=’text/javascript’ src=’/aaggr.js’></script>
</head>
<body>
</body>
</html>
The code below is copied verbatim from https://kielipankki.fi/aaggr.js
It connects to Lindat, delivers the statistics and then redirects to the Géant Checker.
//FILL THESE var shibbolethSessionUrl = "/Shibboleth.sso/Session", spEntityID = "https://sp.www.kielipankki.fi/", aggregator_url='https://clarin-aa.ms.mff.cuni.cz/aaggreg/v1/got'; jQuery.get(shibbolethSessionUrl). done(function(data){ var session = jQuery(data); var idp = session.find("strong:contains('Identity Provider:')")[0].nextSibling.nodeValue.trim(); var attrs = session.find("u:contains('Attributes')").nextAll().map(function(index, el){ return encodeURIComponent(el.innerHTML)}).get(); if(idp){ var ts = new Date().toISOString(); attributes_encoded = "attributes[]=" + attrs.join("&attributes[]="); var logUrl = aggregator_url + '?idp=' + idp + '&sp=' + spEntityID + '×tamp=' + ts + '&' + attributes_encoded + '&source=js_aaggr'; jQuery.get(logUrl) .done(function(){ console.log("Succcessfully sent " + logUrl); }) .always(function(){ document.location.href = '/Shibboleth.sso/AttrChecker' + document.location.search; }); } });