summaryrefslogtreecommitdiffstats
path: root/auth_mellon_util.c
diff options
context:
space:
mode:
authormanu@netbsd.org <manu@netbsd.org@a716ebb1-153a-0410-b759-cfb97c6a1b53>2010-05-31 11:19:26 +0000
committermanu@netbsd.org <manu@netbsd.org@a716ebb1-153a-0410-b759-cfb97c6a1b53>2010-05-31 11:19:26 +0000
commit6d2d83d8f8792acad49ff36155df72eee373b6a7 (patch)
treebadbc94a7e0f22fd2c61318e420579a934c76481 /auth_mellon_util.c
parent40950a7b66ed2999494fdaeab3bddb5b58ad8268 (diff)
downloadmod_auth_mellon-6d2d83d8f8792acad49ff36155df72eee373b6a7.tar.gz
mod_auth_mellon-6d2d83d8f8792acad49ff36155df72eee373b6a7.tar.xz
mod_auth_mellon-6d2d83d8f8792acad49ff36155df72eee373b6a7.zip
Shibboleth 2 interoperability. This is acchieved by increasing the
storage for attributes, as OID-named attributes sent by the Shibboleth IdP consomes quite some space. There is also a required Destination attribute in AuthnRequest elements. It is done by trunk version of lasso, but not by any currently released version, hence we do if it is not done. git-svn-id: https://modmellon.googlecode.com/svn/trunk@85 a716ebb1-153a-0410-b759-cfb97c6a1b53
Diffstat (limited to 'auth_mellon_util.c')
-rw-r--r--auth_mellon_util.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/auth_mellon_util.c b/auth_mellon_util.c
index 6e4a629..576a2dc 100644
--- a/auth_mellon_util.c
+++ b/auth_mellon_util.c
@@ -1204,3 +1204,39 @@ const char *am_get_mime_body(request_rec *r, const char *mime)
/* Turn back LF into CRLF */
return am_add_cr(r, body);
}
+
+/* This function returns the URL for a given provider service (type + method)
+ *
+ * Parameters:
+ * request_rec *r The request
+ * LassoProfile *profile Login profile
+ * char *endpoint_name Service and method as specified in metadata
+ * e.g.: "SingleSignOnService HTTP-Redirect"
+ * Returns:
+ * The endpoint URL that must be freed by caller, or NULL on failure.
+ */
+char *
+am_get_service_url(request_rec *r, LassoProfile *profile, char *service_name)
+{
+ LassoProvider *provider;
+ gchar *url;
+
+ provider = lasso_server_get_provider(profile->server,
+ profile->remote_providerID);
+ if (LASSO_IS_PROVIDER(provider) == FALSE) {
+ ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r,
+ "Cannot find provider service %s, no provider.",
+ service_name);
+ return NULL;
+ }
+
+ url = lasso_provider_get_metadata_one(provider, service_name);
+ if (url == NULL) {
+ ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r,
+ "Cannot find provider service %s from metadata.",
+ service_name);
+ return NULL;
+ }
+
+ return url;
+}