summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorolavmrk <olavmrk@a716ebb1-153a-0410-b759-cfb97c6a1b53>2011-05-18 10:49:03 +0000
committerolavmrk <olavmrk@a716ebb1-153a-0410-b759-cfb97c6a1b53>2011-05-18 10:49:03 +0000
commitcd96f70a8048878dd26aeda52c34ff2d480802bd (patch)
tree4df354493087c0c1b4dc7c610a78467341ecae63
parentc8c66851d89789b633b7040922e1eb49547a2a70 (diff)
downloadmod_auth_mellon-cd96f70a8048878dd26aeda52c34ff2d480802bd.tar.gz
mod_auth_mellon-cd96f70a8048878dd26aeda52c34ff2d480802bd.tar.xz
mod_auth_mellon-cd96f70a8048878dd26aeda52c34ff2d480802bd.zip
Change am_handle_probe_discovery() to use providers from LassoServer.
git-svn-id: https://modmellon.googlecode.com/svn/trunk@125 a716ebb1-153a-0410-b759-cfb97c6a1b53
-rw-r--r--auth_mellon_handler.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/auth_mellon_handler.c b/auth_mellon_handler.c
index b416610..c0379e8 100644
--- a/auth_mellon_handler.c
+++ b/auth_mellon_handler.c
@@ -2558,14 +2558,20 @@ static int am_handle_login(request_rec *r)
*/
static int am_handle_probe_discovery(request_rec *r) {
am_dir_cfg_rec *cfg = am_get_dir_cfg(r);
+ LassoServer *server;
const char *idp = NULL;
int timeout;
- apr_hash_index_t *index;
+ GHashTableIter iter;
char *return_to;
char *idp_param;
char *redirect_url;
int ret;
+ server = am_get_lasso_server(r);
+ if(server == NULL) {
+ return HTTP_INTERNAL_SERVER_ERROR;
+ }
+
/*
* If built-in IdP discovery is not configured, return error.
* For now we only have the get-metadata metadata method, so this
@@ -2618,17 +2624,13 @@ static int am_handle_probe_discovery(request_rec *r) {
* The first to answer is chosen, but the list of usable
* IdP can be restricted in configuration.
*/
- for (index = apr_hash_first(r->pool, cfg->idp_metadata_files);
- index;
- index = apr_hash_next(index)) {
+ g_hash_table_iter_init(&iter, server->providers);
+ while (g_hash_table_iter_next(&iter, (void**)&idp, NULL)) {
void *dontcare;
const char *ping_url;
apr_size_t len;
- apr_ssize_t slen;
long status;
-
- apr_hash_this(index, (const void **)&idp,
- &slen, (void *)&dontcare);
+
ping_url = idp;
/*