„Shib2PersistentId” változatai közötti eltérés

Innen: KIFÜ Wiki
(Új oldal, tartalma: „= Perzisztens azonosító használata Shibboleth2 IdP esetén = == Táblaszerkezet == <source lang="sql"> CREATE TABLE `shibpid` ( `localEntity` varchar(200) NOT NULL, ...”)
 
(jndi connection pool hivatkozás)
 
(7 közbenső módosítás ugyanattól a szerkesztőtől nincs mutatva)
1. sor: 1. sor:
 
= Perzisztens azonosító használata Shibboleth2 IdP esetén =
 
= Perzisztens azonosító használata Shibboleth2 IdP esetén =
 +
Ez az oldal a Shibboleth <code>storedId</code> plugin telepítését írja le MySQL adatbázis motorral.
 +
 +
== Adatbázis driver telepítése ==
 +
A MySQL JDBC driver a következő URL-ről érhető el: http://dev.mysql.com/downloads/#connector-j. Letöltés után a kitömörített drivercsomagból a .jar végű fájlt kell bemásolni a <code>/usr/share/tomcat6/lib</code> könyvtár alá.
  
 
== Táblaszerkezet ==
 
== Táblaszerkezet ==
16. sor: 20. sor:
 
   KEY `i_shibpid_lid` (`localEntity`,`peerEntity`,`localId`),
 
   KEY `i_shibpid_lid` (`localEntity`,`peerEntity`,`localId`),
 
   KEY `i_shibpid_lid_date` (`localEntity`,`peerEntity`,`localId`,`deactivationDate`)
 
   KEY `i_shibpid_lid_date` (`localEntity`,`peerEntity`,`localId`,`deactivationDate`)
) ENGINE=MyISAM DEFAULT CHARSET=utf-8
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8
 
</source>
 
</source>
  
 
== Perzisztens attribútum feloldása ==
 
== Perzisztens attribútum feloldása ==
Az attribute-resolver.xml konfigurációs fájlban vegyük fel a következő !DataConnectort illetve !PrincipalConnectort:
+
Az attribute-resolver.xml konfigurációs fájlban vegyük fel a következő DataConnectort illetve PrincipalConnectort:
  
 
<source lang="xml">
 
<source lang="xml">
31. sor: 35. sor:
 
   <resolver:Dependency ref="myLDAP" />
 
   <resolver:Dependency ref="myLDAP" />
 
   <ApplicationManagedConnection jdbcDriver="com.mysql.jdbc.Driver"
 
   <ApplicationManagedConnection jdbcDriver="com.mysql.jdbc.Driver"
     jdbcURL=""
+
     jdbcURL="jdbc:mysql://localhost/installfest"
     jdbcUserName=""
+
     jdbcUserName="root"
 
     jdbcPassword="" />
 
     jdbcPassword="" />
 
</resolver:DataConnector>
 
</resolver:DataConnector>
40. sor: 44. sor:
 
   nameIDFormat="urn:oasis:names:tc:SAML:2.0:nameid-format:persistent"
 
   nameIDFormat="urn:oasis:names:tc:SAML:2.0:nameid-format:persistent"
 
   storedIdDataConnectorRef="persistentIdConnector" />
 
   storedIdDataConnectorRef="persistentIdConnector" />
 +
</source>
 +
 +
Amennyiben alkalmazásszerver oldali kapcsolatkezelést szeretnénk használni, a [[Shib2IdpConnectionPool|következő leírás]] hasznos lehet.
 +
 +
Definiáljuk a persistentId attribútumot (a transientId ELŐTT! - különben a transientId -t választja ki az idp...):
 +
 +
<source lang="xml">
 +
<resolver:AttributeDefinition id="persistentId" xsi:type="Simple"
 +
  xmlns="urn:mace:shibboleth:2.0:resolver:ad">
 +
    <resolver:Dependency ref="persistentIdConnector" />
 +
    <resolver:AttributeEncoder xsi:type="SAML2StringNameID"
 +
      xmlns="urn:mace:shibboleth:2.0:attribute:encoder"
 +
      nameFormat="urn:oasis:names:tc:SAML:2.0:nameid-format:persistent" />
 +
</resolver:AttributeDefinition>
 
</source>
 
</source>
  

A lap jelenlegi, 2010. szeptember 28., 16:31-kori változata

Perzisztens azonosító használata Shibboleth2 IdP esetén

Ez az oldal a Shibboleth storedId plugin telepítését írja le MySQL adatbázis motorral.

Adatbázis driver telepítése

A MySQL JDBC driver a következő URL-ről érhető el: http://dev.mysql.com/downloads/#connector-j. Letöltés után a kitömörített drivercsomagból a .jar végű fájlt kell bemásolni a /usr/share/tomcat6/lib könyvtár alá.

Táblaszerkezet

CREATE TABLE `shibpid` (
  `localEntity` varchar(200) NOT NULL,
  `peerEntity` varchar(200) NOT NULL,
  `principalName` varchar(200) NOT NULL,
  `localId` varchar(200) NOT NULL,
  `persistentId` varchar(200) NOT NULL,
  `peerProvidedId` varchar(200) default NULL,
  `creationDate` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
  `deactivationDate` timestamp NULL default NULL,
  KEY `i_shibpid_pid` (`persistentId`),
  KEY `i_shibpid_pid_date` (`persistentId`,`deactivationDate`),
  KEY `i_shibpid_lid` (`localEntity`,`peerEntity`,`localId`),
  KEY `i_shibpid_lid_date` (`localEntity`,`peerEntity`,`localId`,`deactivationDate`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8

Perzisztens attribútum feloldása

Az attribute-resolver.xml konfigurációs fájlban vegyük fel a következő DataConnectort illetve PrincipalConnectort:

<resolver:DataConnector xsi:type="StoredId"
  xmlns="urn:mace:shibboleth:2.0:resolver:dc"
  id="persistentIdConnector"
  sourceAttributeID="uid"
  generatedAttributeID="persistentId"
  salt="valami-random-sztring">
  <resolver:Dependency ref="myLDAP" />
  <ApplicationManagedConnection jdbcDriver="com.mysql.jdbc.Driver"
     jdbcURL="jdbc:mysql://localhost/installfest"
     jdbcUserName="root"
     jdbcPassword="" />
</resolver:DataConnector>

<resolver:PrincipalConnector xsi:type="StoredId" 
  xmlns="urn:mace:shibboleth:2.0:resolver:pc" id="saml2Persistent"
  nameIDFormat="urn:oasis:names:tc:SAML:2.0:nameid-format:persistent"
  storedIdDataConnectorRef="persistentIdConnector" />

Amennyiben alkalmazásszerver oldali kapcsolatkezelést szeretnénk használni, a következő leírás hasznos lehet.

Definiáljuk a persistentId attribútumot (a transientId ELŐTT! - különben a transientId -t választja ki az idp...):

<resolver:AttributeDefinition id="persistentId" xsi:type="Simple"
  xmlns="urn:mace:shibboleth:2.0:resolver:ad">
    <resolver:Dependency ref="persistentIdConnector" />
    <resolver:AttributeEncoder xsi:type="SAML2StringNameID" 
      xmlns="urn:mace:shibboleth:2.0:attribute:encoder"
      nameFormat="urn:oasis:names:tc:SAML:2.0:nameid-format:persistent" />
</resolver:AttributeDefinition>

Perzisztens attribútum kódolása a SAML válaszba

Az attribute_filter.xml -ben meg kell adni hogy a frissen létrehozott persistentId attribútumot kiadja az SP-nek:

<AttributeFilterPolicy id="releaseNameIDToAnyone">
    <PolicyRequirementRule xsi:type="basic:ANY" />

    <AttributeRule attributeID="transientId">
        <PermitValueRule xsi:type="basic:ANY" />
    </AttributeRule>
    <AttributeRule attributeID="persistentId">
        <PermitValueRule xsi:type="basic:ANY" />
    </AttributeRule>
</AttributeFilterPolicy>