mace-opensaml-users - Re: [OpenSAML] Failed to add <ds:keyinfo> element into the subjectConfirmationData object
Subject: OpenSAML user discussion
List archive
Re: [OpenSAML] Failed to add <ds:keyinfo> element into the subjectConfirmationData object
Chronological Thread
- From: Thilina Mahesh Buddhika <>
- To:
- Subject: Re: [OpenSAML] Failed to add <ds:keyinfo> element into the subjectConfirmationData object
- Date: Fri, 10 Jul 2009 00:35:40 +0530
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=w4b8pF/r9AFh7qbWoCFAn/JYDETr13CSzb+JJkOR5BQzs+soRhfWAlAc0EgscoUCz8 Tbbo4wd/OUjluJNAKIn7HjuOIx6VvutJoRmnKhNLaUHKvTZeq26MiRluKIeP6mgUT0ET F7BL4zD9PGXhYo8NoiErxazg2tomvUTAZV8Qw=
Thanks Bryn. It worked fine.
/thilina
E-Mail :
I blog here : http://thilinamb.com
subjData.getUnknownXMLObjects().add(keyInfoElement);
From: Thilina Mahesh Buddhika [mailto:]
Sent: Thursday, July 09, 2009 10:18 AM
To:
Subject: [OpenSAML] Failed to add <ds:keyinfo> element into the subjectConfirmationData object
hi,
I am trying to build a SAML 2.0 assertion with holder-of-key subject confirmation method. I have created a <ds:keyInfo> element and unmarshelled it to an instance of org.opensaml.xml.XMLObject. Then I am trying to add this object to a subjectConfirmationData object using the following code segment.
-------------------------------------------------------------------------------------------------------------------------------------------------------------
UnmarshallerFactory unmarshallerFactory = Configuration.getUnmarshallerFactory();
Unmarshaller unmarshaller = unmarshallerFactory.getUnmarshaller(keyInfoElem);
XMLObject keyInfoElement = nmarshaller.unmarshall(keyInfoElem);
SAMLObjectBuilder<SubjectConfirmationData> subjectConfirmationDataBuilder =
(SAMLObjectBuilder<SubjectConfirmationData>) builderFactory.getBuilder(SubjectConfirmationData.DEFAULT_ELEMENT_NAME);
SubjectConfirmationData subjectConfirmationData = subjectConfirmationDataBuilder.buildObject();
subjectConfirmationData.setNotBefore(creationTime);
subjectConfirmationData.setNotOnOrAfter(expirationTime);
//Add the Element that containts X509 certificate into the SubjectCOnfirmationData element
subjectConfirmationData.getOrderedChildren().add(keyInfoElement);
----------------------------------------------------------------------------------------------------------------------------------------------------------------
when I am trying to add the keyinfo element to the subjectConfirmationData object, I am hitting with this error.
-------------------------------------------------------------------------
java.lang.UnsupportedOperationException
at java.util.Collections$UnmodifiableCollection.add(Collections.java:1018)
at org.apache.rahas.impl.SAML2TokenIssuer.createSubject(SAML2TokenIssuer.java:408)
at org.apache.rahas.impl.SAML2TokenIssuer.issue(SAML2TokenIssuer.java:154)
at org.apache.rahas.TokenRequestDispatcher.handle(TokenRequestDispatcher.java:70)
-------------------------------------------------------------------------------------------------------------------------------------------------
I debugged the method implementation of geOrderedChildren in org.opensaml.saml2.core.impl.SubjectConfirmationDataImpl class, and found that it provides a non-editable collection object.
public List<XMLObject> getOrderedChildren() {
return Collections.unmodifiableList(unknownChildren);
}
So the above exception makes sense.
What is the correct approach to add XMLObjects into SAMLConfirmationData object ? Am I missing anything ?
Thanks in advance.
best regards,
/thilina
E-Mail :
I blog here : http://thilinamb.com
DISCLAIMER:
This email message and all attachments transmitted with it are for the sole use of the intended recipient(s) and may contain confidential and privileged information. Please DO NOT forward this email outside of the recipient's Company unless expressly authorized to do so herein. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.Any views expressed in this email message are those of the individual sender except where the sender specifically states them to be the views of Ventyx.
- Failed to add <ds:keyinfo> element into the subjectConfirmationData object, Thilina Mahesh Buddhika, 07/09/2009
- RE: [OpenSAML] Failed to add <ds:keyinfo> element into the subjectConfirmationData object, Bryn Ryans, 07/09/2009
- Re: [OpenSAML] Failed to add <ds:keyinfo> element into the subjectConfirmationData object, Thilina Mahesh Buddhika, 07/09/2009
- Re: [OpenSAML] Failed to add <ds:keyinfo> element into the subjectConfirmationData object, Brent Putman, 07/09/2009
- RE: [OpenSAML] Failed to add <ds:keyinfo> element into the subjectConfirmationData object, Bryn Ryans, 07/09/2009
Archive powered by MHonArc 2.6.16.