Some more tinkering with OpenID.
authorArt Cancro <ajc@citadel.org>
Sun, 18 May 2008 04:42:58 +0000 (04:42 +0000)
committerArt Cancro <ajc@citadel.org>
Sun, 18 May 2008 04:42:58 +0000 (04:42 +0000)
Also changed webcit.c so that if DEBUG_URLSTRINGS is defined,
all urlstrings will be displayed for each transaction, eliminating
the need to uncomment that code.

webcit/auth.c
webcit/webcit.c

index e637da46a73d89342f720339d43468a8f8b54601..f0eed0e6a098b1865d6f3094f2b1b527d1db8eef 100644 (file)
@@ -336,7 +336,7 @@ void extract_link(char *target_buf, int target_size, char *rel, char *source_buf
 
 /* 
  * Perform authentication using OpenID
- * assemble the checkid_immediate request and then redirect to the user's identity provider
+ * assemble the checkid_setup request and then redirect to the user's identity provider
  */
 void do_openid_login(void)
 {
@@ -386,13 +386,14 @@ void do_openid_login(void)
 
                        snprintf(redirect_string, sizeof redirect_string,
                                "%s"
-                               "?openid.mode=checkid_immediate"
+                               "?openid.mode=checkid_setup"
                                "&openid_identity=%s"
                                "&openid.return_to=%s"
                                "&openid.trust_root=%s"
                                ,
                                openid_server, escaped_identity, escaped_return_to, escaped_trust_root
                        );
+                       lprintf(CTDL_DEBUG, "OpenID server contacted; redirecting to %s\n", redirect_string);
                        http_redirect(redirect_string);
                        return;
                }
@@ -403,30 +404,19 @@ void do_openid_login(void)
 }
 
 /* 
- * Perform authentication using OpenID
- * assemble the checkid_immediate request and then redirect to the user's identity provider
+ * Complete the authentication using OpenID
+ * This function handles the positive or negative assertion from the user's Identity Provider
  */
 void finish_openid_login(void)
 {
-       if (havebstr("openid.user_setup_url")) {
-               http_redirect(bstr("openid.user_setup_url"));
-               return;
-       }
-
        if (havebstr("openid.mode")) {
-               if (!strcasecmp(bstr("openid.mode"), "error")) {
-                       if (havebstr("openid.error")) {
-                               display_openid_login(bstr("openid.error"));
-                       }
-                       else {
-                               display_openid_login(_("Your password was not accepted."));
-                       }
-                       return;
-               }
-       }
+               if (!strcasecmp(bstr("openid.mode"), "id_res")) {
 
+                       display_openid_login("FIXME id accepted but the code isn't finished");
+                       //FIXME finish this
 
-       // FIXME finish this
+               }
+       }
 
        if (WC->logged_in) {
                if (WC->need_regi) {
index 1aea8de3775c14252e07fb7007ce6a9073987f45..258bdce1507f330a6c013dffe2c6591011e2de5c 100644 (file)
@@ -141,9 +141,10 @@ void addurls(char *url)
                u->url_data[u->url_data_size] = '\0';
                up = bptr;
                ++up;
-/* uncomment the following line to see each parameter in the log
+
+#ifdef DEBUG_URLSTRINGS
                lprintf(9, "%s = [%ld]  %s\n", u->url_key, u->url_data_size, u->url_data); 
-*/
+#endif
        }
 }