Change am_handle_probe_discovery() to use providers from LassoServer.

git-svn-id: https://modmellon.googlecode.com/svn/trunk/mod_mellon2@125 a716ebb1-153a-0410-b759-cfb97c6a1b53
This commit is contained in:
olavmrk 2011-05-18 10:49:03 +00:00
parent fbd59b5a1d
commit e48e01904c
1 changed files with 10 additions and 8 deletions

View File

@ -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;
/*