* @param role metadata role to decorate
* @param handlerURL base location of handler's endpoint
*/
- virtual void generateMetadata(opensaml::saml2md::SPSSODescriptor& role, const char* handlerURL) const {
- }
+ virtual void generateMetadata(opensaml::saml2md::SPSSODescriptor& role, const char* handlerURL) const;
/**
* Returns the "type" of the Handler plugin.
#ifndef SHIBSP_LITE
const char* getType() const;
+ void generateMetadata(opensaml::saml2md::SPSSODescriptor& role, const char* handlerURL) const;
#endif
};
{
}
+#ifndef SHIBSP_LITE
+
+void Handler::generateMetadata(SPSSODescriptor& role, const char* handlerURL) const
+{
+}
+
+#endif
+
const XMLCh* Handler::getProtocolFamily() const
{
return nullptr;
#ifndef SHIBSP_LITE
void generateMetadata(opensaml::saml2md::SPSSODescriptor& role, const char* handlerURL) const {
+ SessionInitiator::generateMetadata(role, handlerURL);
for (vector<SessionInitiator*>::const_iterator i = m_handlers.begin(); i!=m_handlers.end(); ++i)
(*i)->generateMetadata(role, handlerURL);
}
#include "handler/SessionInitiator.h"
#include <xmltooling/XMLToolingConfig.h>
-#include <xmltooling/impl/AnyElement.h>
#include <xmltooling/util/URLEncoder.h>
using namespace shibsp;
#ifndef SHIBSP_LITE
void generateMetadata(SPSSODescriptor& role, const char* handlerURL) const {
- static const XMLCh LOCAL_NAME[] = UNICODE_LITERAL_17(D,i,s,c,o,v,e,r,y,R,e,s,p,o,n,s,e);
-
// Initial guess at index to use.
pair<bool,unsigned int> ix = getUnsignedInt("index");
if (!ix.first)
using namespace xmltooling;
using namespace std;
+#ifndef SHIBSP_LITE
+# include <saml/saml2/metadata/Metadata.h>
+using namespace opensaml::saml2md;
+#endif
+
namespace shibsp {
SHIBSP_DLLLOCAL PluginManager< SessionInitiator,string,pair<const DOMElement*,const char*> >::Factory ChainingSessionInitiatorFactory;
SHIBSP_DLLLOCAL PluginManager< SessionInitiator,string,pair<const DOMElement*,const char*> >::Factory Shib1SessionInitiatorFactory;
{
return "SessionInitiator";
}
+
+void SessionInitiator::generateMetadata(SPSSODescriptor& role, const char* handlerURL) const
+{
+ if (getParent())
+ return;
+ const char* loc = getString("Location").second;
+ string hurl(handlerURL);
+ if (*loc != '/')
+ hurl += '/';
+ hurl += loc;
+ auto_ptr_XMLCh widen(hurl.c_str());
+
+ RequestInitiator* ep = RequestInitiatorBuilder::buildRequestInitiator();
+ ep->setLocation(widen.get());
+ ep->setBinding(samlconstants::SP_REQUEST_INIT_NS);
+ Extensions* ext = role.getExtensions();
+ if (!ext) {
+ ext = ExtensionsBuilder::buildExtensions();
+ role.setExtensions(ext);
+ }
+ ext->getUnknownXMLObjects().push_back(ep);
+}
#endif
const set<string>& SessionInitiator::getSupportedOptions() const