Fwd: Generating the response ...
Brent Putman
putmanb at georgetown.edu
Tue Jul 9 12:50:52 EDT 2013
On 7/9/2013 10:25 AM, Thomas Smets wrote:
>
>
> 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).
I'm not familiar with it, but they apparently have a mistake, unless you
mis-pasted something.
>
> Subject subject = new SubjectBuilder().buildObject();
>
> NameID lNameId = SAMLElementFactory.generateNameId(subject, valueToSet);
>
> subject.setNameID(lNameId); // <-- Fails HERE
>
> ....
>
Yes, it fails there because that call is already being made inside of
the SAMLElementFactory.generateNameId:
> 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);
>
As in right there. You can't do it twice, so pick one approach or the
other.
--Brent
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://shibboleth.net/pipermail/dev/attachments/20130709/4f3b3612/attachment.html
More information about the dev
mailing list