From c8c66851d89789b633b7040922e1eb49547a2a70 Mon Sep 17 00:00:00 2001 From: olavmrk Date: Wed, 18 May 2011 10:48:57 +0000 Subject: Change am_get_idp() to use providers from LassoServer. git-svn-id: https://modmellon.googlecode.com/svn/trunk@124 a716ebb1-153a-0410-b759-cfb97c6a1b53 --- auth_mellon_handler.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/auth_mellon_handler.c b/auth_mellon_handler.c index b299ee3..b416610 100644 --- a/auth_mellon_handler.c +++ b/auth_mellon_handler.c @@ -344,14 +344,17 @@ static const char *am_first_idp(request_rec *r) */ static const char *am_get_idp(request_rec *r) { - am_dir_cfg_rec *cfg = am_get_dir_cfg(r); + LassoServer *server; const char *idp_provider_id; - const char *idp_metadata_file; + + server = am_get_lasso_server(r); + if (server == NULL) + return NULL; /* * If we have a single IdP, return that one. */ - if (apr_hash_count(cfg->idp_metadata_files) == 1) + if (g_hash_table_size(server->providers) == 1) return am_first_idp(r); /* @@ -367,10 +370,7 @@ static const char *am_get_idp(request_rec *r) "Could not urldecode IdP discovery value."); idp_provider_id = NULL; } else { - idp_metadata_file = apr_hash_get(cfg->idp_metadata_files, - idp_provider_id, - APR_HASH_KEY_STRING); - if (idp_metadata_file == NULL) + if (g_hash_table_lookup(server->providers, idp_provider_id) == NULL) idp_provider_id = NULL; } @@ -2641,7 +2641,6 @@ static int am_handle_probe_discovery(request_rec *r) { if (value == NULL) { /* idp not in list, try the next one */ - idp = NULL; continue; } else { /* idp in list, use the value as the ping url */ -- cgit