diff options
| author | Benjamin Dauvergne <bdauvergne@entrouvert.com> | 2008-08-01 14:09:47 +0000 |
|---|---|---|
| committer | Benjamin Dauvergne <bdauvergne@entrouvert.com> | 2008-08-01 14:09:47 +0000 |
| commit | e4fda38df5db9567ab84939d0bb0fd087377e060 (patch) | |
| tree | d66693cec36cb2b39a1adf540658c9441968c3de | |
| parent | 0e6b3cd72e1726b2ceba91d7263b42bfa1f8e9c6 (diff) | |
beginning of signature implementation for SAML authentication
| -rw-r--r-- | lasso/id-wsf/wsf_profile.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/lasso/id-wsf/wsf_profile.c b/lasso/id-wsf/wsf_profile.c index f8865468..a4b76c9a 100644 --- a/lasso/id-wsf/wsf_profile.c +++ b/lasso/id-wsf/wsf_profile.c @@ -643,6 +643,7 @@ lasso_wsf_profile_build_soap_request_msg(LassoWsfProfile *profile) xmlCharEncodingHandler *handler; xmlDoc *doc = NULL; xmlNode *envelope_node = NULL; + char *sec_mech_id = NULL; g_return_val_if_fail(LASSO_IS_WSF_PROFILE(profile), LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); g_return_val_if_fail(LASSO_IS_SOAP_ENVELOPE(profile->soap_envelope_request), @@ -653,7 +654,20 @@ lasso_wsf_profile_build_soap_request_msg(LassoWsfProfile *profile) envelope_node = lasso_node_get_xmlNode(LASSO_NODE(envelope), FALSE); xmlDocSetRootElement(doc, envelope_node); /* Sign request if necessary */ - // lasso_wsf_profile_sign_request(profile, doc) + sec_mech_id = profile->private_data->security_mech_id; + if (lasso_security_mech_id_is_saml_authentication(sec_mech_id)) { + const xmlChar* ids[2] = { + (xmlChar*) "id", + NULL + }; + /* Add a signature to soap:Header/wsse:Security on: + * soap:Header/sb:Correlation + * soap:Header/sb:Provider + * éventuellement soap:Header/sb:UserInteraction + * soap:Body + */ + xmlSecAddIDs(doc, envelope_node, ids); + } /* Dump soap request */ handler = xmlFindCharEncodingHandler("utf-8"); buf = xmlAllocOutputBuffer(handler); |
