From 2c835be36e1a5a3f2f94d757a9726a210f8bfa8d Mon Sep 17 00:00:00 2001 From: Nicolas Clapies Date: Thu, 23 Nov 2006 09:02:55 +0000 Subject: Added missing updates about LassoEcp object. --- lasso/saml-2.0/ecp.c | 28 +++++++++++++++++++++++++++- lasso/saml-2.0/ecp.h | 2 +- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/lasso/saml-2.0/ecp.c b/lasso/saml-2.0/ecp.c index ec3c10ff..88c759da 100644 --- a/lasso/saml-2.0/ecp.c +++ b/lasso/saml-2.0/ecp.c @@ -25,6 +25,11 @@ #include #include +#include +#include +#include +#include + #include /*****************************************************************************/ @@ -87,6 +92,10 @@ lasso_ecp_process_authn_request_msg(LassoEcp *ecp, const char *authn_request_msg xmlNode *xmlnode; xmlOutputBuffer *buf; xmlCharEncodingHandler *handler; + LassoProfile *profile; + LassoProvider *remote_provider; + + profile = LASSO_PROFILE(ecp); if (authn_request_msg == NULL) { return critical_error(LASSO_PROFILE_ERROR_MISSING_REQUEST); @@ -117,6 +126,22 @@ lasso_ecp_process_authn_request_msg(LassoEcp *ecp, const char *authn_request_msg g_strdup((char*)(buf->conv ? buf->conv->content : buf->buffer->content)); xmlOutputBufferClose(buf); + profile->remote_providerID = lasso_server_get_first_providerID(profile->server); + if (profile->remote_providerID == NULL) { + return critical_error(LASSO_SERVER_ERROR_PROVIDER_NOT_FOUND); + } + + remote_provider = g_hash_table_lookup(profile->server->providers, + profile->remote_providerID); + if (LASSO_IS_PROVIDER(remote_provider) == FALSE) + return critical_error(LASSO_SERVER_ERROR_PROVIDER_NOT_FOUND); + + profile->msg_url = lasso_provider_get_metadata_one(remote_provider, + "SingleSignOnService SOAP"); + if (profile->msg_url == NULL) { + return critical_error(LASSO_PROFILE_ERROR_UNKNOWN_PROFILE_URL); + } + return 0; } @@ -232,11 +257,12 @@ lasso_ecp_get_type() * occured **/ LassoEcp* -lasso_ecp_new() +lasso_ecp_new(LassoServer *server) { LassoEcp *ecp; ecp = g_object_new(LASSO_TYPE_ECP, NULL); + LASSO_PROFILE(ecp)->server = g_object_ref(server); return ecp; } diff --git a/lasso/saml-2.0/ecp.h b/lasso/saml-2.0/ecp.h index 59882db3..52798125 100644 --- a/lasso/saml-2.0/ecp.h +++ b/lasso/saml-2.0/ecp.h @@ -59,7 +59,7 @@ struct _LassoEcpClass { LASSO_EXPORT GType lasso_ecp_get_type(void); -LASSO_EXPORT LassoEcp* lasso_ecp_new(); +LASSO_EXPORT LassoEcp* lasso_ecp_new(LassoServer *server); LASSO_EXPORT int lasso_ecp_process_authn_request_msg(LassoEcp *ecp, const char *authn_request_msg); -- cgit