2 * Copyright 2001-2005 Internet2
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
25 #ifndef __internal_h__
26 #define __internal_h__
28 #include <saml/saml.h>
29 #include <shib/shib.h>
30 #include <shib-target/shib-target.h>
31 #include <shib-target/hresult.h>
33 #include <log4cpp/Category.hh>
35 #define ADFS_LOGCAT "shibtarget"
36 #define SHIBTRAN_LOGCAT "Shibboleth-TRANSACTION"
37 #define ADFS_L(s) adfs::XML::Literals::s
41 extern shibtarget::IListener* g_MemoryListener;
47 static const XMLCh WSFED_NS[]; // http://schemas.xmlsoap.org/ws/2003/07/secext
48 static const XMLCh WSTRUST_NS[]; // http://schemas.xmlsoap.org/ws/2005/02/trust
49 static const XMLCh WSTRUST_SCHEMA_ID[];
53 static const XMLCh RequestedSecurityToken[];
54 static const XMLCh RequestSecurityTokenResponse[];
58 // TODO: Publish these classes for reuse by extensions.
62 CgiParse(const char* data, unsigned int len);
64 const char* get_value(const char* name) const;
66 static char x2c(char *what);
67 static void url_decode(char *url);
68 static std::string url_encode(const char* s);
70 char * fmakeword(char stop, unsigned int *cl, const char** ppch);
71 char * makeword(char *line, char stop);
72 void plustospace(char *str);
74 std::map<std::string,char*> kvp_map;
77 // Helper class for SAML 2.0 Common Domain Cookie operations
78 class CommonDomainCookie
81 CommonDomainCookie(const char* cookie);
82 ~CommonDomainCookie() {}
83 saml::Iterator<std::string> get() {return m_list;}
84 const char* set(const char* providerId);
85 static const char CDCName[];
87 std::string m_encoded;
88 std::vector<std::string> m_list;
91 saml::SAMLAuthenticationStatement* checkAssertionProfile(const saml::SAMLAssertion* a);