diff options
author | Frederic Peters <fpeters@entrouvert.com> | 2006-11-02 14:13:19 +0000 |
---|---|---|
committer | Frederic Peters <fpeters@entrouvert.com> | 2006-11-02 14:13:19 +0000 |
commit | 44ad1a38ccc811673b188c6bbf017d3e67e7e3ac (patch) | |
tree | 777968377b8a1f99a7ef39beef420b4ec650acd9 | |
parent | d43bde7827c9da6d503285d9d3685b2151e68cb3 (diff) | |
download | lasso-44ad1a38ccc811673b188c6bbf017d3e67e7e3ac.tar.gz lasso-44ad1a38ccc811673b188c6bbf017d3e67e7e3ac.tar.xz lasso-44ad1a38ccc811673b188c6bbf017d3e67e7e3ac.zip |
new lasso_profile_is_saml_query function
-rw-r--r-- | lasso/id-ff/profile.c | 2 | ||||
-rw-r--r-- | lasso/saml-2.0/Makefile.am | 3 | ||||
-rw-r--r-- | lasso/saml-2.0/profile.c | 23 | ||||
-rw-r--r-- | lasso/saml-2.0/profile.h | 39 |
4 files changed, 66 insertions, 1 deletions
diff --git a/lasso/id-ff/profile.c b/lasso/id-ff/profile.c index d761490f..788a1f4b 100644 --- a/lasso/id-ff/profile.c +++ b/lasso/id-ff/profile.c @@ -153,7 +153,7 @@ lasso_profile_get_request_type_from_soap_msg(const gchar *soap) * Tests the query string to know if the URL is called as the result of a * Liberty redirect (action initiated elsewhere) or not. * - * Return value: TRUE if lasso query, FALSE otherwise + * Return value: TRUE if Liberty query, FALSE otherwise **/ gboolean lasso_profile_is_liberty_query(const gchar *query) diff --git a/lasso/saml-2.0/Makefile.am b/lasso/saml-2.0/Makefile.am index 7f38fc95..2cf1477a 100644 --- a/lasso/saml-2.0/Makefile.am +++ b/lasso/saml-2.0/Makefile.am @@ -16,6 +16,9 @@ liblasso_saml_20_la_SOURCES = \ login.c \ logout.c +liblassoinclude_HEADERS = \ + profile.h + lasso_private_h_sources = \ federationprivate.h \ profileprivate.h \ diff --git a/lasso/saml-2.0/profile.c b/lasso/saml-2.0/profile.c index b4968c2d..1509c6e0 100644 --- a/lasso/saml-2.0/profile.c +++ b/lasso/saml-2.0/profile.c @@ -279,4 +279,27 @@ lasso_saml20_profile_process_artifact_response(LassoProfile *profile, const char return 0; } +/** + * lasso_saml20_profile_is_saml_query: + * @query: HTTP query string + * + * Tests the query string to know if the URL is called as the result of a + * SAML redirect (action initiated elsewhere) or not. + * + * Return value: TRUE if SAML query, FALSE otherwise + **/ +gboolean +lasso_profile_is_saml_query(const gchar *query) +{ + gchar *parameters[] = { + "SAMLRequest=", "SAMLResponse=", "SAMLart=", NULL }; + gint i; + + for (i=0; parameters[i]; i++) { + if (strstr(query, parameters[i])) + return TRUE; + } + + return FALSE; +} diff --git a/lasso/saml-2.0/profile.h b/lasso/saml-2.0/profile.h new file mode 100644 index 00000000..51b5c505 --- /dev/null +++ b/lasso/saml-2.0/profile.h @@ -0,0 +1,39 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __LASSO_SAML2_PROFIL_H__ +#define __LASSO_SAML2_PROFIL_H__ + +#ifdef __cplusplus +extern "C" { + +#endif /* __cplusplus */ + +LASSO_EXPORT gboolean lasso_profile_is_saml_query(const gchar *query); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_SAML2_PROFIL_H__ */ |