[SIDP-411] - Check for loginContext != null at login.jsp
[SIDP-409] - Pass IdP w/o authenticating
[SIDP-407] - Shibboleth SSO profile handler sets incorrect protocol string in outbound message context
+[SIDP-403] - Use text/xml as the media type for returned metadata unless user agent request metadata media type
[SIDP-402] - Update 3rd party libraries for 2.2 release
[SIDP-397] - Remove any unit test that won't be fixed in the 2.X branch, fix the rest
[SIDP-396] - Previous session LoginHandler used even if authentication method has expired
import java.io.File;
import java.io.OutputStreamWriter;
+import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.opensaml.Configuration;
public void processRequest(InTransport in, OutTransport out) throws ProfileException {
XMLObject metadata;
+ HttpServletRequest httpRequest = ((HttpServletRequestAdapter)in).getWrappedRequest();
HttpServletResponse httpResponse = ((HttpServletResponseAdapter)out).getWrappedResponse();
- httpResponse.setContentType("application/samlmetadata+xml");
+
+ String acceptHeder = DatatypeHelper.safeTrimOrNullString(httpRequest.getHeader("Accept"));
+ if(acceptHeder != null && !acceptHeder.contains("application/samlmetadata+xml")){
+ httpResponse.setContentType("application/xml");
+ }else{
+ httpResponse.setContentType("application/samlmetadata+xml");
+ }
try {
String requestedEntity = DatatypeHelper.safeTrimOrNullString(((HttpServletRequestAdapter) in)