Fwd: Generating the response ...

Thomas Smets tsmets at a3-system.eu
Tue Jul 9 11:25:12 EDT 2013


Hello,


I find it particularly hard to generate the Response (Request is completed).
I seem to lack some steps in what is needed to fill the <saml:Subject> with
the values expected.
Has anybody a little bit of code to share ... ?

Anonymous part of the Stack trace is here below :
java.lang.IllegalArgumentException: org.opensaml.saml2.core.impl.NameIDImpl
cannot be added - it is already the child of another SAML Object
 at
org.opensaml.xml.AbstractXMLObject.prepareForAssignment(AbstractXMLObject.java:351)
at org.opensaml.saml2.core.impl.SubjectImpl.setNameID(SubjectImpl.java:79)

I based my code on the example code :
https://svn.wso2.org/repos/wso2/carbon/platform/trunk/components/identity/org.wso2.carbon.identity.sso.saml/src/main/java/org/wso2/carbon/identity/sso/saml/builders/ResponseBuilder.java(my
code is currently almost a copy-paste from the sample since I removed
all the namespaces & ... to use the default values).

Subject subject = new SubjectBuilder().buildObject();

NameID lNameId = SAMLElementFactory.generateNameId(subject, valueToSet);

 subject.setNameID(lNameId);  // <-- Fails HERE

....

    /**

     *

     * @param subject

     * @param aNameQualifier

     * @return

     */

    public static NameID generateNameId(Subject subject, String aValue) {

    if (LOG.isTraceEnabled())

     LOG.trace("Generate NameID");

        NameID nameId = new NameIDBuilder().buildObject();

        nameId.setValue(aValue);

        subject.setNameID(nameId);

        return nameId;

    }

I have not registered anything in the "Configuration" of the SAML at
bootstrap time (or later).

So ... I have just NO IDEA what I should specify to "basically said"
deregister from the first child :) (which I have the felling, I did not
register).

Tx,

\T,






--
Thomas Lionel Smets
A3 SYSTEM sprl-bvba
M : +32 497 44 6812
T : +32 2 852 3341
Skype : thomas.lionel.smets
@ : Thomas.Smets at a3-system.eu
Always accurate info : http://tsmets.myplaxo.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://shibboleth.net/pipermail/dev/attachments/20130709/72fddcd9/attachment.html 


More information about the dev mailing list