cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Beucher Thierry <thierry.beuc...@worldline.com>
Subject RE: FEDIZ-15 patch (Support the publish of the WS-Federation Metadata document)
Date Thu, 05 Sep 2013 09:22:01 GMT
Hi Oli,

"UTF-8" in OutputStreamWriter constructor only seems enough ....

Writer streamWriter = new OutputStreamWriter(bout, "UTF-8");
 XMLStreamWriter writer = XML_OUTPUT_FACTORY.createXMLStreamWriter(streamWriter);
...
writer.writeStartDocument();

Thanks


-----Message d'origine-----
De : Oliver Wulff [mailto:owulff@talend.com]
Envoyé : mercredi 4 septembre 2013 21:52
À : dev@cxf.apache.org
Objet : RE: FEDIZ-15 patch (Support the publish of the WS-Federation Metadata document)


Hi Thierry

Thanks for spotting that. I think I have to update that during the creation of the OutputStreamWriter
as well:

Writer streamWriter = new OutputStreamWriter(bout, "UTF-8"); XMLStreamWriter writer = XML_OUTPUT_FACTORY.createXMLStreamWriter(streamWriter);
...
writer.writeStartDocument("UTF-8", "1.0");

You agree?

Thanks
Oli


------

Oliver Wulff

Blog: http://owulff.blogspot.com
Solution Architect
http://coders.talend.com

Talend Application Integration Division http://www.talend.com

________________________________________
From: Beucher Thierry [thierry.beucher@worldline.com]
Sent: 04 September 2013 17:36
To: dev@cxf.apache.org
Subject: FEDIZ-15 patch (Support the publish of the WS-Federation Metadata document)

HI Oli,

I am currently testing your FEDIZ-15 patch and it fails in unit tests of fediz-idp : an issue
related to file encoding IBM1252 not supported is raised during writing of metadatas (at document
signature phase) ...

Running org.apache.cxf.fediz.service.idp.util.MetadataWriterTest
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 42.943 sec <<< FAILURE!
testWriteIDPMetadata(org.apache.cxf.fediz.service.idp.util.MetadataWriterTest)  Time elapsed:
39.16 sec  <<< ERROR!
java.lang.RuntimeException: Error creating service metadata information: IBM1252
       at org.apache.cxf.fediz.service.idp.util.MetadataWriter.getMetaData(MetadataWriter.java:209)
       at org.apache.cxf.fediz.service.idp.util.MetadataWriterTest.testWriteIDPMetadata(MetadataWriterTest.java:52)

below the metadatas file to be signed :

<?xml version='1.0' encoding='IBM1252'?> <EntityDescriptor ID="_96E3E566F42872B96B13783064585181"
entityID="https://localhost:8443/fediz-idp/federation" xmlns:fed="http://docs.oasis-open.org/wsfed/federation/200706"
xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:auth="http://docs.oasis-open.org/wsfed/federation/200706"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <fed:RoleDescriptor xsi:type="fed:SecurityTokenServiceType" protocolSupportEnumeration="http://docs.oasis-open.org/wsfed/federation/200706"
ServiceDescription="IDP of Realm A" ServiceDisplayName="REALM A">
    <KeyDescriptor use="signing">
      <KeyInfo>
        <X509Data>
          <X509Certificate>MIICwTCCAamgAwIBAgIEFKo9KjANBgkqhkiG9w0BAQsFADARMQ8wDQYDVQQDEwZSRUFMTUEwHhcNMTMwOTAzMjAyMjMxWhcNMjMwNzEzMjAyMjMxWjARMQ8wDQYDVQQDEwZSRUFMTUEwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCnmQKgcHaFmTG/rMzlSP1DDVUn1AIVlUo2eBNBaOloKvyXrYT6zwd+mno1Skj9EQMntx9LvK6xLiquLvuKP0XGeWHhJwgG4dBB1QQ71hosrWIaClLQrNuV8d8pztSkPfVrL5SdmlqDUAlC598rGhU7ttXPKp2FF8set2QIDSFZrRURpeAoh7aCdlySrJGBQsTGTvb4N6yF8yoxKcVBIBb62q4xS1qU10Oa+iYig3+b+vNwSzcN5RE9Etw+nQ8q8soiwfGcVLmWjv1oDuLrx1BOqL2zXxmISlJgv2/cC3DVnPb6IOmHaEklLbod7Nq0JgD0L27s4Js+ccXtkoBcQtRxAgMBAAGjITAfMB0GA1UdDgQWBBSSn4p1eScqsNyywCH37ipMdZNykzANBgkqhkiG9w0BAQsFAAOCAQEAnkmNaVR3lXJWh4nOvNvzXz6vBSMbm/K4khu8mRtUWHikbwZE72ZLCD2Bv69YhNsaAZmtH02CERUXZTbh8YXfZ0VnMh9ieTKHWpNGDOBdvfsd8jSLd4svIrP2vfMciS0px0Q87W4jntiQovhPuTEeOOanaG8R2eaROTONRsTQxWWGep5FqhH6Of2hL7kwEjFyLDE/NIMHHeURlxmbwwMbnJoA8/wVOZnGOCkmnKs96DXHD+MBCboD+2UMl76GONiksAsD+LjiqZwZeWsZCP+NDPEjXOv/7MzpiCSMLLk+AWzQAZDqpDwjys1YXREbVVFVlS+3Sob0hd0SJr/hsHl9Hw==
          </X509Certificate>
        </X509Data>
      </KeyInfo>
    </KeyDescriptor>
    <fed:SecurityTokenServiceEndpoint>
      <wsa:EndpointReference>
        <wsa:Address>https://localhost:0/fediz-idp-sts/REALMA
        </wsa:Address>
      </wsa:EndpointReference>
    </fed:SecurityTokenServiceEndpoint>
    <fed:PassiveRequestorEndpoint>
      <wsa:EndpointReference>
        <wsa:Address>https://localhost:8443/fediz-idp/federation
        </wsa:Address>
      </wsa:EndpointReference>
    </fed:PassiveRequestorEndpoint>
  </fed:RoleDescriptor>
</EntityDescriptor>


A fix in MetadataWriter at line #96 solves it :

            writer.writeStartDocument("UTF-8","1.0");

Does it make sense to take care of various encodings ?
Strangely I didn't encountered the same issue for MetadataWriter on project 'core' side ....

Thanks


________________________________

Ce message et les pi?ces jointes sont confidentiels et r?serv?s ? l'usage exclusif de ses
destinataires. Il peut ?galement ?tre prot?g? par le secret professionnel. Si vous recevez
ce message par erreur, merci d'en avertir imm?diatement l'exp?diteur et de le d?truire. L'int?grit?
du message ne pouvant ?tre assur?e sur Internet, la responsabilit? de Worldline ne pourra
?tre recherch?e quant au contenu de ce message. Bien que les meilleurs efforts soient faits
pour maintenir cette transmission exempte de tout virus, l'exp?diteur ne donne aucune garantie
? cet ?gard et sa responsabilit? ne saurait ?tre recherch?e pour tout dommage r?sultant d'un
virus transmis.

This e-mail and the documents attached are confidential and intended solely for the addressee;
it may also be privileged. If you receive this e-mail in error, please notify the sender immediately
and destroy it. As its integrity cannot be secured on the Internet, the Worldline liability
cannot be triggered for the message content. Although the sender endeavours to maintain a
computer virus-free network, the sender does not warrant that this transmission is virus-free
and will not be liable for any damages resulting from any virus transmitted.


Ce message et les pièces jointes sont confidentiels et réservés à l'usage exclusif de
ses destinataires. Il peut également être protégé par le secret professionnel. Si vous
recevez ce message par erreur, merci d'en avertir immédiatement l'expéditeur et de le détruire.
L'intégrité du message ne pouvant être assurée sur Internet, la responsabilité de Worldline
ne pourra être recherchée quant au contenu de ce message. Bien que les meilleurs efforts
soient faits pour maintenir cette transmission exempte de tout virus, l'expéditeur ne donne
aucune garantie à cet égard et sa responsabilité ne saurait être recherchée pour tout
dommage résultant d'un virus transmis.

This e-mail and the documents attached are confidential and intended solely for the addressee;
it may also be privileged. If you receive this e-mail in error, please notify the sender immediately
and destroy it. As its integrity cannot be secured on the Internet, the Worldline liability
cannot be triggered for the message content. Although the sender endeavours to maintain a
computer virus-free network, the sender does not warrant that this transmission is virus-free
and will not be liable for any damages resulting from any virus transmitted.

Mime
View raw message