<div dir="ltr"><div><div><div>Hi,<br><br>I'm trying to get persistent nameIds working on my test IdP, but am having trouble when I try to add DB backing.<br><br></div><div>Any help much appreciated.<br><br></div>My log shows:<br><br>2015-11-06 22:26:04,864 - DEBUG [org.opensaml.saml.saml2.profile.impl.AddNameIDToSubjects:286] - Profile Action AddNameIDToSubjects: Attempting to add NameID to outgoing Assertion Subjects<br>2015-11-06 22:26:04,865 - DEBUG [org.opensaml.saml.common.profile.logic.AbstractNameIDPolicyPredicate:215] - Applying policy to NameIDPolicy with Format urn:oasis:names:tc:SAML:2.0:nameid-format:persistent<br>2015-11-06 22:26:04,866 - DEBUG [org.opensaml.saml.saml2.profile.impl.AddNameIDToSubjects:316] - Profile Action AddNameIDToSubjects: Request specified NameID format: urn:oasis:names:tc:SAML:2.0:nameid-format:persistent<br>2015-11-06 22:26:04,866 - DEBUG [org.opensaml.saml.saml2.profile.impl.AddNameIDToSubjects:396] - Profile Action AddNameIDToSubjects: Trying to generate NameID with Format urn:oasis:names:tc:SAML:2.0:nameid-format:persistent<br>2015-11-06 22:26:04,872 - ERROR [org.opensaml.saml.saml2.profile.impl.AddNameIDToSubjects:404] - Profile Action AddNameIDToSubjects: Error while generating NameID<br>org.opensaml.saml.common.SAMLException: Invalid NameIdentifierGenerationService configuration<br>    at net.shibboleth.idp.saml.nameid.impl.ProxySAML2NameIDGenerator.generate(ProxySAML2NameIDGenerator.java:62)<br>2015-11-06 22:26:04,873 - WARN [org.opensaml.saml.saml2.profile.impl.AddNameIDToSubjects:337] - Profile Action AddNameIDToSubjects: Request specified use of an unsupportable identifier format: urn:oasis:names:tc:SAML:2.0:nameid-format:persistent<br>2015-11-06 22:26:04,876 - DEBUG [org.opensaml.saml.common.profile.logic.DefaultLocalErrorPredicate:184] - Error event InvalidNameIDPolicy will be handled with response<br><br></div>saml-nameid.properties:<br> Properties involving SAML NameIdentifier/NameID generation/consumption<br># See saml-nameid.xml and c14n/subject-c14n.xml for advanced settings<br><br># Set to shibboleth.StoredTransientIdGenerator for server-side storage<br>idp.transientId.generator = shibboleth.StoredTransientIdGenerator<br><br># Set to shibboleth.StoredPersistentIdGenerator for db-backed storage<br># and uncomment/name the PersistentIdStore bean to use<br>idp.persistentId.generator = shibboleth.StoredPersistentIdGenerator<br>idp.persistentId.store = PersistentIdStore<br># Set this to null to skip hash-based generation of first stored ID<br>#idp.persistentId.computed = shibboleth.ComputedPersistentIdGenerator<br>idp.persistentId.computed = null<br><br># Otherwise for computed PersistentIDs set the source attribute and salt.<br>idp.persistentId.sourceAttribute = uid<br>idp.persistentId.salt = spice0fLife<br>idp.persistentId.algorithm = SHA<br><br># Comment out to disable legacy NameID generation via Attribute Resolver<br>#idp.nameid.saml2.legacyGenerator = shibboleth.LegacySAML2NameIDGenerator<br>#idp.nameid.saml1.legacyGenerator = shibboleth.LegacySAML1NameIdentifierGenerator<br><br># Default NameID formats to use when nothing else is called for<br>idp.nameid.saml2.default = urn:oasis:names:tc:SAML:2.0:nameid-format:persistent<br>#idp.nameid.saml1.default = urn:mace:shibboleth:1.0:nameIdentifier<br><br></div>saml-nameid.xml:<br><?xml version="1.0" encoding="UTF-8"?><br><beans xmlns="<a href="http://www.springframework.org/schema/beans">http://www.springframework.org/schema/beans</a>"<br>       xmlns:context="<a href="http://www.springframework.org/schema/context">http://www.springframework.org/schema/context</a>"<br>       xmlns:util="<a href="http://www.springframework.org/schema/util">http://www.springframework.org/schema/util</a>"<br>       xmlns:p="<a href="http://www.springframework.org/schema/p">http://www.springframework.org/schema/p</a>"<br>       xmlns:c="<a href="http://www.springframework.org/schema/c">http://www.springframework.org/schema/c</a>"<br>       xmlns:xsi="<a href="http://www.w3.org/2001/XMLSchema-instance">http://www.w3.org/2001/XMLSchema-instance</a>"<br>       xsi:schemaLocation="<a href="http://www.springframework.org/schema/beans">http://www.springframework.org/schema/beans</a> <a href="http://www.springframework.org/schema/beans/spring-beans.xsd">http://www.springframework.org/schema/beans/spring-beans.xsd</a><br>                           <a href="http://www.springframework.org/schema/context">http://www.springframework.org/schema/context</a> <a href="http://www.springframework.org/schema/context/spring-context.xsd">http://www.springframework.org/schema/context/spring-context.xsd</a><br>                           <a href="http://www.springframework.org/schema/util">http://www.springframework.org/schema/util</a> <a href="http://www.springframework.org/schema/util/spring-util.xsd">http://www.springframework.org/schema/util/spring-util.xsd</a>"<br>                           <br>       default-init-method="initialize"<br>       default-destroy-method="destroy"<br>    <br>    <!-- SAML 2 NameID Generation --><br>    <util:list id="shibboleth.SAML2NameIDGenerators"><br>    <br>        <ref bean="shibboleth.SAML2TransientGenerator" /><br>        <br>        <ref bean="shibboleth.SAML2PersistentGenerator" /><br> <br>    </util:list><br><br>    <!-- SAML 1 NameIdentifier Generation --><br>    <util:list id="shibboleth.SAML1NameIdentifierGenerators"><br>        <ref bean="shibboleth.SAML1TransientGenerator" /><br>    </util:list><br><br>    <bean id="PersistentIdStore" parent="net.shibboleth.idp.saml.nameid.impl.JDBCPersistentIdStore"><br>        <property name="dataSource"><br>            <bean class="org.apache.commons.dbcp2.BasicDataSource"<br>                p:driverClassName="org.h2.Driver"<br>                p:url="jdbc:h2:/opt/shibboleth-idp/PersistentIdStore.h2"<br>                p:username="sa"<br>                p:password=""<br>                p:maxIdle="5"<br>                p:maxWaitMillis="15000"<br>                p:testOnBorrow="true"<br>                p:validationQuery="select 1"<br>                p:validationQueryTimeout="5" /><br>        </property><br>    </bean><br></beans><br><br></div>