File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -87,7 +87,15 @@ public static function getCurrentBinding() : Binding
8787 return new HTTPPost ();
8888 } elseif (array_key_exists ('SAMLart ' , $ _POST )) {
8989 return new HTTPArtifact ();
90- } elseif ($ contentType === 'text/xml ' || $ contentType === 'application/soap+xml ' ) {
90+ } elseif (
91+ /**
92+ * The registration information for text/xml is in all respects the same
93+ * as that given for application/xml (RFC 7303 - Section 9.1)
94+ */
95+ ($ contentType === 'text/xml ' || $ contentType === 'application/xml ' )
96+ // See paragraph 3.2.3 of Binding for SAML2 (OASIS)
97+ || (isset ($ _SERVER ['HTTP_SOAPACTION ' ]) && $ _SERVER ['HTTP_SOAPACTION ' ] === 'http://www.oasis-open.org/committees/security ' ))
98+ {
9199 return new SOAP ();
92100 }
93101 break ;
Original file line number Diff line number Diff line change @@ -78,12 +78,21 @@ public function testBindingGuesserPOST() : void
7878 $ bind = Binding::getCurrentBinding ();
7979 $ this ->assertInstanceOf (SOAP ::class, $ bind );
8080
81+ $ _SERVER ['CONTENT_TYPE ' ] = 'application/xml ' ;
82+ $ bind = Binding::getCurrentBinding ();
83+ $ this ->assertInstanceOf (SOAP ::class, $ bind );
84+
85+ unset($ _SERVER ['CONTENT_TYPE ' ]);
86+ $ _SERVER ['HTTP_SOAPACTION ' ] = 'http://www.oasis-open.org/committees/security ' ;
87+ $ bind = Binding::getCurrentBinding ();
88+ $ this ->assertInstanceOf (SOAP ::class, $ bind );
89+ unset($ _SERVER ['HTTP_SOAPACTION ' ]);
90+
8191 $ _POST = ['SAMLart ' => 'AAQAAI4sWYpfoDDYJrHzsMnG+jyNM94p5ejn49a+nZ0s3ylY7knQ6tkLMDE= ' ];
8292 $ bind = Binding::getCurrentBinding ();
8393 $ this ->assertInstanceOf (HTTPArtifact::class, $ bind );
8494
8595 $ _POST = ['AAP ' => 'Noot ' ];
86- unset($ _SERVER ['CONTENT_TYPE ' ]);
8796 $ this ->expectException (UnsupportedBindingException::class, 'Unable to find the current binding. ' );
8897 $ bind = Binding::getCurrentBinding ();
8998 }
You can’t perform that action at this time.
0 commit comments