Použití atributu eduPersonTargetedId

Atribut eduPersonTargetedId se používá pro persistentni a jednoznačnou identifikaci uživatele na daném SP v případech, kdy je nežádoucí aby SP dostával informace o identitě uživatele. Hodnota tohoto atributu by měla být unikátní pro různé SP. Shibboleth Service Provider 1.3 nepodporuje nativně potřebnou funkcionalitu. Tu je potřeba implementovat použitím skriptovacích možností u definici atributů.

V LDAPu se uživatelům přidělí atribut (říkejme mu třeba SPTID) obsahující dvojici - targetedID oddělené mezerou - „SP_ID TargetedID“, kde SP_ID je ID service providera a TargetedID je hodnota pro daný SP.

V konfiguračním souboru resolver.xml se nadefinuje:

<!--
This scriptlet aquires the value of the eduPersonTargetedID into an
unscoped atribute _urn_for_SPTID_
-->
 
<ScriptletAttributeDefinition id="_urn_for_SPTID_">
   <DataConnectorDependency requires="directory"/>
   <Scriptlet><![CDATA[
 
Attributes attributes = dependencies.getConnectorResolution("directory");
 
Attribute serID = attributes.get("SPTID");
 
String value = "";
int index;
 
for (int i = 0; serID != null && i < serID.size(); i++) {
  value = serID.get(i).toString();
 
  if (value.startsWith(requester + " ")) {
    for (index = requester.length();
         value.charAt(index) == ' ' && index < value.length();
         index++) {
    }
    if (index >= value.length()) {
// log the error and try next
      continue;
    }
    resolverAttribute.addValue(value.substring(index));
    break;
  }
}
]]>
   </Scriptlet>
</ScriptletAttributeDefinition>
 
<!--
This definition adds the required scope to the eduPersonTargetedID value
gathered in _urn_for_SPTID_
-->
 
<SimpleAttributeDefinition
    id="urn:mace:dir:attribute-def:eduPersonTargetedID"
    smartScope="scope.example.cz">
  <AttributeDependency requires="_URN_for_SPTID_"/>
</SimpleAttributeDefinition>
cztestfed/howto/idp/config/targeted_id/index.txt · Poslední úprava: 2008-05-09 15:20 (upraveno mimo DokuWiki)
CESNET2 powered
CC Attribution-Noncommercial-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0