597b74c
commit 5ba9bb72707a90503cd4d042083ea074a0cb6b8a
597b74c
Author: John Dennis <jdennis@redhat.com>
597b74c
Date:   Fri Oct 30 15:46:33 2015 -0400
597b74c
597b74c
    Role maybe unknown when assertion consumer url is looked up
597b74c
    
597b74c
    Replace the call to lasso_provider_get_metadata_one() with
597b74c
    lasso_provider_get_metadata_one_for_role() so that we can exlicitly
597b74c
    pass the LASSO_PROVIDER_ROLE_SP role. The former call obtains the
597b74c
    role from the provider object and then calls
597b74c
    lasso_provider_get_metadata_one_for_role() using that role. However
597b74c
    the role will not have been set in the provider until the first request is
597b74c
    processed. This means the first time we call this routine it won't
597b74c
    work correctly because the role will not have been set yet, by
597b74c
    explicitly passing the role we avoid this problem.
597b74c
    
597b74c
    Signed-off-by: John Dennis <jdennis@redhat.com>
597b74c
597b74c
diff --git a/auth_mellon_util.c b/auth_mellon_util.c
597b74c
index 155bb1a..6c694b7 100644
597b74c
--- a/auth_mellon_util.c
597b74c
+++ b/auth_mellon_util.c
597b74c
@@ -1827,7 +1827,9 @@ char *am_get_assertion_consumer_service_by_binding(LassoProvider *provider, cons
597b74c
     }
597b74c
 
597b74c
     if (selected_descriptor) {
597b74c
-        url = lasso_provider_get_metadata_one(provider, selected_descriptor);
597b74c
+        url = lasso_provider_get_metadata_one_for_role(provider,
597b74c
+                                                       LASSO_PROVIDER_ROLE_SP,
597b74c
+                                                       selected_descriptor);
597b74c
     }
597b74c
 
597b74c
     lasso_release_list_of_strings(descriptors);