summaryrefslogtreecommitdiffstats
path: root/lasso/saml-2.0/profile.c
diff options
context:
space:
mode:
Diffstat (limited to 'lasso/saml-2.0/profile.c')
-rw-r--r--lasso/saml-2.0/profile.c23
1 files changed, 23 insertions, 0 deletions
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;
+}