[keycloak-dev] unsupported media type error

John Dennis jdennis at redhat.com
Fri Jan 15 19:00:31 EST 2016


On 01/15/2016 12:52 PM, Pedro Igor Silva wrote:
> Hey John,
>
>      KC expects a POST using the "application/soap+xml" media type. Maybe we should also provide a text/xml for SOAP 1.1 clients.
>
> Regards.
> Pedro Igor

I asked Pedro to wait and not change anything in Keycloak until I 
checked the specs. Based on my reading of the specs the media type (i.e. 
HTTP Content-Type header) should be

   text/xml

The media type 'application/soap+xml' is reserved for SOAP 1.2. RFC 3902 
"The "application/soap+xml" media type" states:

   The "application/soap+xml" media type explicitly identifies SOAP 1.2
   message envelopes that have been serialised with XML 1.0; message
   envelopes with a different SOAP namespace version or using another
   XML serialisation MUST NOT use it.

The "SAML V2.0 Enhanced Client or Proxy Profile Version 2.0" (current as 
of August 2013) states that SAML messages are wrapped in SOAP 1.1.

The "Simple Object Access Protocol (SOAP) 1.1" spec 
(https://www.w3.org/TR/2000/NOTE-SOAP-20000508/) in Section 6 "Using 
SOAP in HTTP" states:

    HTTP applications MUST use the media type "text/xml" according to
    RFC 2376 when including SOAP entity bodies in HTTP messages.

Therefore since ECP requires SOAP 1.1 (not SOAP 1.2) and SOAP 1.1 
requires 'text/xml' and because RFC 3902 reserves 'application/soap+xml' 
for SOAP 1.2 the media type should be 'text/xml' not 'application/soap+xml'.

I am partly to blame for the confusion, Pedro and I used an ECP test 
program I wrote and it erroneously used the incorrect 
'application/soap+xml' media type and I think Pedro adjusted Keycloak to 
match based on that.


> ----- Original Message -----
> From: "John Dennis" <jdennis at redhat.com>
> To: keycloak-dev at lists.jboss.org
> Sent: Friday, January 15, 2016 3:36:09 PM
> Subject: [keycloak-dev] unsupported media type error
>
> I'm trying to test Openstack ECP with Keycloak. When Openstack posts the
> SAML AuthnRequest wrapped in SOAP to the
> /auth/realms/master/protocol/saml endpoint keycloak responds with an
> HTTP 415 unsupported media type error. The HTTP Content-Type in the post
> is text/xml. What are you expecting?
>
> This is with the 1.8.0.CR1 version of keycloak.
>
> Thanks!
>


-- 
John


More information about the keycloak-dev mailing list